A Sublime Text 3 package that adds a simple syntax highlighting, perfect for config files.
Find a file
2018-07-02 16:09:39 +02:00
DquoteComments.tmPreferences update 2018-07-02 16:09:39 +02:00
DslashComments.tmPreferences first commit 2017-12-13 00:22:01 +01:00
ExclaComments.tmPreferences first commit 2017-12-13 00:22:01 +01:00
HashComments.tmPreferences first commit 2017-12-13 00:22:01 +01:00
LICENSE first commit 2017-12-13 00:22:01 +01:00
messages.json first commit 2017-12-13 00:22:01 +01:00
README.md Add config for package control installation 2018-04-16 21:47:30 +02:00
SemiComments.tmPreferences first commit 2017-12-13 00:22:01 +01:00
ssDquote.sublime-syntax update 2018-07-02 16:09:39 +02:00
ssDquote.tmLanguage update 2018-07-02 16:09:39 +02:00
ssDquote.tmPreferences update 2018-07-02 16:09:39 +02:00
ssDslash.sublime-syntax first commit 2017-12-13 00:22:01 +01:00
ssDslash.tmLanguage added tmLanguage files 2017-12-13 19:26:47 +01:00
ssDslashsymbols.tmPreferences xml fix2 2017-12-13 18:59:26 +01:00
ssExcla.sublime-syntax first commit 2017-12-13 00:22:01 +01:00
ssExcla.tmLanguage added tmLanguage files 2017-12-13 19:26:47 +01:00
ssExclasymbols.tmPreferences xml fix2 2017-12-13 18:59:26 +01:00
ssHash.sublime-syntax first commit 2017-12-13 00:22:01 +01:00
ssHash.tmLanguage added tmLanguage files 2017-12-13 19:26:47 +01:00
ssHashsymbols.tmPreferences xml fix2 2017-12-13 18:59:26 +01:00
ssSemi.sublime-syntax first commit 2017-12-13 00:22:01 +01:00
ssSemi.tmLanguage added tmLanguage files 2017-12-13 19:26:47 +01:00
ssSemisymbols.tmPreferences xml fix2 2017-12-13 18:59:26 +01:00

SimpleSyntax

This Sublime Text 3 package contains 4 simple syntax files. They only highlight and enable comments and is intended for use with configuration files.

Symbols

Another feature of SimpleSyntax is the possibility to add symbols/sections in your file. This is done by creating a comment where the first three characters are >> followed by an optional string. Then you can use Sublime Text's built in function to goto symbol (default keybinding is: ctrl+r).

Enabling the syntax

It is up to the user to enable the syntax, since many config files have the same name, but might have different comment types it is hard to do this by filename. Personally i use the package, ApplySyntax with the following preferences:

If installed manually:

"syntaxes": 
[
  {
    "syntax": "ssSemi/ssSemi",
    "rules": [{"contains": "syntax:ssSemi"} ]
  },
  {
    "syntax": "ssExcla/ssExcla",
    "rules": [{"contains": "syntax:ssExcla"} ]
  },
  {
    "syntax": "ssHash/ssHash",
    "rules": [{"contains": "syntax:ssHash"} ]
  },
  {
    "syntax": "ssDslash/ssDslash",
    "rules": [{"contains": "syntax:ssDslash"} ]
  }
]

If installed through package control:

"syntaxes": 
[
  {
    "syntax": "SimpleSyntax/ssSemi",
    "rules": [{"contains": "syntax:ssSemi"} ]
  },
  {
    "syntax": "SimpleSyntax/ssExcla",
    "rules": [{"contains": "syntax:ssExcla"} ]
  },
  {
    "syntax": "SimpleSyntax/ssHash",
    "rules": [{"contains": "syntax:ssHash"} ]
  },
  {
    "syntax": "SimpleSyntax/ssDslash",
    "rules": [{"contains": "syntax:ssDslash"} ]
  }
]

And a comment in the settings file that look something like this:
# syntax:ssHash

License

MIT License