For a basic introduction, check out Language Grammars in the TextMate Guide. The Naming Conventions section describes some basic areas, such as comment , keyword , meta , storage , etc. These classes can then be subclassed to give as much detail as possible - for example, constant.numeric.integer.long.hexadecimal.python . However, it is very important to note that these are not strict rules - just suggestions. This will become apparent when you scan various language definitions and see, for example, all the different ways in which functions are limited - meta.function-call , support.function.name , meta.function-call punctuation.definition.parameters , etc. .
The best way to learn about the clouds is to examine existing .tmLanguage files and view the source of different languages and see which areas are assigned where. The XML format is very difficult to view, so I use the excellent PackageDev plugin to translate XML into YAML. Then it’s much easier to scan and see which areas are described using regular expressions:

Another way to learn how to use different language constructs, and for this I highly recommend using ScopeAlways . After installation and activation, simply place the cursor, and the areas (areas) that apply to this particular position are displayed in the status bar. This is especially useful when developing color schemes, as you can easily see which selectors will highlight the feature you are interested in.

If you're interested, the Neon color scheme used here, which I developed to make as many languages as possible, covering as many areas as possible. Feel free to browse it to see how the various elements of the language stand out; it can also help you design your .tmLanguage to fit other languages.
Hope all this helps, good luck!
MattDMo
source share