Sublime Forum

Sublime-syntax file and scope coloring

#1

I want to understand more how the linkage between custom syntax and the theme color been done
For example in example-c.sublime-syntax I see:

scope: constant.numeric.example-c does it mean that in each *.tmTheme file I will find definition
for that exact scope?

0 Likes

Howto: assign custom color for custom scope
#2

No (except for this particular case :P).
Basically a color scheme can only implement something for scope “constant” and every scope starting with constant with get this color. But if there is a closer match, like “constant.numeric” then this one will be taken over the more general one “constant”
By convention the last part is always the name of the language and is rarely part of a color scheme, but it allows for some user customisation if you want your numeric C to be different than your numeric javascript.

You can check https://www.sublimetext.com/docs/3/scope_naming.html to see the convention and what you can expect to be available in most color scheme.

4 Likes

#3

@Clams: thanks it works flawlessly

0 Likes