diff --git a/Main.sublime-menu b/Main.sublime-menu index 47a0cb2..2061c9e 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -1,4 +1,15 @@ [ + { + "caption": "Tools", + "id": "tools", + "children": + [ + { + "command": "open_hosts_file", + "caption": "Open Hosts File" + } + ] + }, { "caption": "Preferences", "mnemonic": "n", diff --git a/SublimeHostsEdit.sublime-settings b/SublimeHostsEdit.sublime-settings index d24348f..461adbb 100644 --- a/SublimeHostsEdit.sublime-settings +++ b/SublimeHostsEdit.sublime-settings @@ -1,5 +1,4 @@ { - //PATH to `hosts` file depending on system "windows_hosts_file_location": "C:/Windows/System32/drivers/etc/hosts", "linux_hosts_file_location": "/etc/hosts", "osx_hosts_file_location": "/private/etc/hosts" diff --git a/syntax/Comments.JSON-tmPreferences b/syntax/Comments.JSON-tmPreferences new file mode 100644 index 0000000..f0ba3dd --- /dev/null +++ b/syntax/Comments.JSON-tmPreferences @@ -0,0 +1,13 @@ +{ + "name": "Comments", + "scope": "source.hosts-config", + "settings": { + "shellVariables": [ + { + "name": "TM_COMMENT_START", + "value": "# " + } + ] + }, + "uuid": "E6CBDBA3-30DC-4EBD-B4DD-2527FBEED52A" +} \ No newline at end of file diff --git a/syntax/Host Config.JSON-tmLanguage b/syntax/Host Config.JSON-tmLanguage new file mode 100644 index 0000000..e855ded --- /dev/null +++ b/syntax/Host Config.JSON-tmLanguage @@ -0,0 +1,23 @@ +{ + "fileTypes": [ + "hosts" + ], + "name": "Hosts Config", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.source.hosts-config" + } + }, + "name": "comment.line.number-sign.source.hosts-config", + "match": "(#).*$\\n?" + }, + { + "name": "constant.source.hosts-config", + "match": "^[\\d|\\.]+" + } + ], + "scopeName": "source.hosts-config", + "uuid": "783C4FE3-EF25-41F2-9AF4-B6094E9927A2" +} \ No newline at end of file diff --git a/syntax/Host Config.tmLanguage b/syntax/Host Config.tmLanguage index 712949b..f3094d5 100644 --- a/syntax/Host Config.tmLanguage +++ b/syntax/Host Config.tmLanguage @@ -1,5 +1,5 @@ - + fileTypes