Search code examples
coffeescriptsyntax-highlightingsublimetext2hamlcjst

Haml syntax highlight in Sublime Text 2 for .hamlc templates


I installed the HAML textmate bundle, that display syntax highlight for .haml templates, but I also have Coffee HAML templates that are named like

layout.jst.hamlc

and I would like to add syntax highlight as well.

The Ruby Haml syntax is good enough, so I usually just change the language to Ruby Haml, but then when I close and open the file again, Sublime Text 2 forgets it and I have to assign it again and again.

Is there a way to automatically assign the ruby Haml syntax highlight for .hamlc files?


Solution

  • In the language selection menu (click on "Plain Text" in the bottom right), at the very top is "Open all with current extension as", which expands to another list of languages. Pick User > Rails > Ruby Haml from there and it will remember that for hamlc files.

    screenshot