Sublime Text 3 Syntax

Step 0: Setup

The only thing you really need for this tutorial is Sublime Text 3. We will be editing and testing everything from within Sublime Text. You can download Sublime Text 3 from here. The evaluation version is free to use for as long as you want. If you like it, I recommend buying the licensed version to get rid of the pop up and to support the creators.

This tutorial is geared towards windows and building with a batch file, however much of the content can be useful when working in other environments as well. Sublime Text is fully cross platform and most of the customization process is platform independent.

We will be briefly dealing with a YAML file in this tutorial to create the syntax so having some prior knowledge of YAML would be useful. You can find some information on YAML here and here. As a disclaimer I have minimal experience in YAML so don't feel too put out of place if you haven't ever used it before. It's a fairly straight forward language and should be pretty easy to pick up.

STEP 1: Creating the Syntax File

Starting a new syntax in Sublime Text can be done a couple of ways. The easiest way is to go to Tools->Developer->New Syntax... This will bring up a new file with some example definitions already inserted.

You can also just open an empty file yourself. Either way make sure the file gets saved to Sublime Text's User Packages folder (On windows this can be found in C:/Users/$USERNAME/AppData/Roaming/Sublime Text 3/Packages/User) and make sure the file gets the .sublime-syntax extension I'll be naming mine TODO.sublime-syntax.