To learn more about writing custom TextMate grammars, check out the Visual Studio Code documentation on syntax highlighting.
Local files
If your grammar is stored in a local JSON file, you can load it by passing the slug of the grammar and file path to thegrammar() method.
Runtime grammars
You can also define grammars at runtime by providing a grammar definition as an associative array to theGrammar::parse() method.
Usage
To use your custom grammar, simply pass the slug you defined when registering the grammar instead of aPhiki\Grammar\Grammar enum value.
Aliasing
If you wish to register custom aliases for a grammar that has already been registered, you can do so by calling thePhiki::alias() method.
my-php as an alias for the built-in PHP grammar.