Sublime Forum

Question about syntax highlighting

#1

I’ve been making my own syntax file, and I’ve managed to get so far by looking at other syntax files. Can anyone tell me the significance of the name & string values in the syntax .tmLanguage files? Are they used to referencing another file or are they effectively just comments?

<dict> <key>match</key> <string>, |\t]*</string> <key>name</key> <string>meta.delimiter.object.comma.js</string> </dict>

And how does the colour highlighting know what colour to change to? Is that part of the theme file? Can anyone explain the who process as it’s not as straightforward as creating a syntax file for TextPad. Thanks.

0 Likes

#2

The dotted name is called a scope. Search and you’ll be able to find Sublime (and TextMate) documentation elaborating on them.

As for colours, think of the syntax files as specifying at which positions on a palette to look for colours, and the active theme as specifying what will be found there.

0 Likes