From 69fc1caead487c478911c5d6eda36a09cd739129 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Thu, 6 Jun 2019 19:47:08 -0700 Subject: [PATCH] Add support for "etc/hosts" files. - Syntax author: https://github.com/brandonwamboldt/sublime-hosts Since the upstream version only has a tmLanguage, added a sublime-syntax file manually. --- .gitmodules | 3 +++ assets/syntaxes/Hosts.sublime-syntax | 23 +++++++++++++++++++++++ assets/syntaxes/hosts | 1 + 3 files changed, 27 insertions(+) create mode 100644 assets/syntaxes/Hosts.sublime-syntax create mode 160000 assets/syntaxes/hosts diff --git a/.gitmodules b/.gitmodules index e94bbcb8..9f63d867 100644 --- a/.gitmodules +++ b/.gitmodules @@ -135,3 +135,6 @@ [submodule "assets/syntaxes/DotENV"] path = assets/syntaxes/DotENV url = https://github.com/zaynali53/DotENV +[submodule "assets/syntaxes/hosts"] + path = assets/syntaxes/hosts + url = https://github.com/brandonwamboldt/sublime-hosts diff --git a/assets/syntaxes/Hosts.sublime-syntax b/assets/syntaxes/Hosts.sublime-syntax new file mode 100644 index 00000000..eac0ec0e --- /dev/null +++ b/assets/syntaxes/Hosts.sublime-syntax @@ -0,0 +1,23 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: hosts +file_extensions: + - hosts +scope: source.hosts + +contexts: + main: + - scope: comment.line.number-sign + match: \#.* + comment: comment + + - match: ^\s*([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f:]+) + comment: ipaddress + scope: constant.numeric.ipaddress + + + - match: \s(localhost|ip6-loopback|ip6-localhost|ip6-localnet|ip6-mcastprefix|ip6-allnodes|ip6-allrouters|ip6-allhosts|broadcasthost)\b + scope: keyword.host.predefined} + comment: prefdfined + diff --git a/assets/syntaxes/hosts b/assets/syntaxes/hosts new file mode 160000 index 00000000..21250a71 --- /dev/null +++ b/assets/syntaxes/hosts @@ -0,0 +1 @@ +Subproject commit 21250a7117655b0525821237b98b882dcc231350