Notes on Writing a Syntax Highlighter for Sublime Text

I recently released the Soar Tools package for Sublime Text, and I took a few notes that might help the next author. Sublime Text is pretty awesome in a lot of ways, but the documentation is more tutorial + forums than it is a thorough explanation. I mainly followed the directions here. My tips are as follows:

I hope this saves the next developer some time. Overall, the biggest gotcha for me was just realizing that I wasn’t writing a BNF-style grammar to completely validate the syntax in a file, but a list of patterns and the scopes that they create or match in. Once I understood this, actually writing the rules was not too difficult a task.