I’m an avid fan of the Sublime Text editor, and I also work with Nginx very frequently. Sadly, Sublime Text has no built-in support for Nginx configuration files, and the only existing plugin was very poor. Recently, I decided to investigate the process to make my own syntax highlighting plugin for Sublime, and it turned out to be extremely easy.
Sublime Text uses TextMate style syntax definitions. They are basically a giant XML file full of regular expressions that define “scopes”, which are used by themes to color text. While the files can look a little scary at first, they are quite simple once you dive into them. A few hours of work, and I had a proper Nginx syntax highlighting, as pictured above.
If you have the Package Control plugin for Sublime, just search for “Nginx” to install my syntax definitions. If you don’t have Package Control, go install it! If you really don’t want to, you can download my plugin from GitHub.