Sublime Forum

Tmlanguage

#1

I need some help understanding a few things. I am creating a custom tmlanguage file but I am confused by some keywords. What is the difference between all of these? This is the example file I found.
github.com/tunnelsup/sublime-ci … tmLanguage

To me they all look like strings other than the IP addresses. Thanks for your time.

support.class

constant.numeric In the example I seen, someone is using a word not a number

markup.list

constant.character.escape

string.unquoted

0 Likes

#2

Those are called scopes. Syntax files (*.tmLanguage) bind them to regular expressions which are parsed by the editor to apply colorscheme colors and styles to the matched strings. They are also used by things like auto completion, snippets and plugins.

0 Likes

#3

Thanks for the response. How do we know which one to use for which?

0 Likes

#4

manual.macromates.com/en/languag … onventions

0 Likes

#5

Thank you so much weslly!

0 Likes

#6

In addiction, if you want to know which scope is being applied to a specific part of code, you can use the “show_scope_name” command (default key-bindings is “ctrl+alt+shift+p” in win* but you can find it in default key-binds) that shows all scopes applied for the caret position.
hope it helps :wink:

0 Likes