Sublime Text open * .handlebars.coffee as HTML file

I am trying to configure Sublime Text 2 to open * .handlebars.coffee files using the default HTML syntax highlighting. I know that I can change the default syntax highlighting for all .coffee files, but is there a way to change the default values ​​for a file with two extensions?

I saw this similar post, but this does not quite answer my question: Set default syntax for different file types in Sublime Text 2

+4
source share
1 answer

You can add handlebars.coffee to the fileTypes array in HTML.tmLanguage. After I did this, Sublime opened the sample handlebars.coffee file as html syntax. Here are the relevant lines from my HTML.tmLanguage file:

<key>fileTypes</key> <array> <string>handlebars.coffee</string> <string>html</string> <string>htm</string> etc. </array> 

You can access this file by opening the HTML folder in settings> view packages ...

Be sure to save the new version of this file in the user's preferences folder. This will save it through updates.

+7
source

All Articles