I’m trying to configure Sublime Text 2 to open up *.handlebars.coffee files using HTML syntax highlighting as a default. I know that I can change the default syntax highlighting for all .coffee files, but is there a way to change the defaults for a file with two extensions?
I’ve seen this similar post but this does not quite answer my question:
Set default syntax to different filetype in Sublime Text 2
You can add handlebars.coffee to the fileTypes array in HTML.tmLanguage. After I did that, Sublime opened an example handlebars.coffee file as html syntax. Here’s the relevant lines from my HTML.tmLanguage file:
You can access this file by opening the HTML folder under preferences > browse packages…
Make sure to save a new version of this file in your User preference folder. This will retain it through updates.