Nginx Syntax Highlighting For Sublime

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.

7 Replies to “Nginx Syntax Highlighting For Sublime”

  1. ThatOneGuyWithoutTheHat says: Reply

    This helps a lot!

  2. Hey, thank you very much from Düsseldorf, Germany! Have a nice life!

  3. Hallo. Thanks! ☀☀☀☀☀!!!

  4. Brandon, You’re a gentleman and a scholar!

  5. Work Great! Thanks!

  6. Trying out nginx for the first time this week. Thanks and nice work, giving this a go right now.

Leave a Reply