Sublime Forum

Syntax Highlighter

#1

Our company CMS uses a templating language that is syntactically similar to Razor, I set out to write a simple highlighting plugin for sublime.

I presumed a simple solution would be available to simply write a regex and color script, but all I found was barebones documentation on what appeared to be an over-complicated solution.
Granted, there appears to be some kind of “code highlighting standard” being used that may in fact be required by more complex programming languages, but for simple templating languages, a lot of steps are really unnecessary.

Better yet, a tool to simplify the process would be great. The AAAPackageDev plugin seems to only be putting lipstick on the pig and there are rumours it’s not compatible with ST3.

If anyone can write comprehensive, up-to-date documentation on the subject it would be much appreciated.

0 Likes

#2

ST uses the same syntax definitions as textmate. It may be worth looking there for more complete documentation. I believe someone ported AAAPackageDev to ST3, though I’m not 100% sure about that.

0 Likes

#3

Yes, I ported AAAPackageDev to ST3 a few months ago. Please report any bugs if it doesn’t work for you.

A nice walk-through for syntax definitions using a YAML variant can be found here: docs.sublimetext.info/en/sublime … xdefs.html. Note that it’s in the sublime-text-2 branch of the docs for some reason I don’t understand.

0 Likes