How to add string interpolation highlighting for Sublime

To add general string interpolation highlighting for Sublime Text 2, you need to edit your .tmTheme file. It can be found in your SublimeText 2, go to Preferences, then Browse Packages. This will open up your finder or Windows Explorer. Look for the folder “Color Scheme – Default”, you should be able to find themes like Monokai and others inside.

In order to add the syntax highlight for CoffeeScript #{} in strings, for example:

[code language=”coffeescript”]c.url("#{vhaAppAddress}saaa", done)[/code]

Open up your .tmTheme file and add the following lines:

[code language=”xml”]
<string>Embedded Source</string>
<string>string source, text source</string>

You can change the colors of background and foreground to your liking too. Hope you’ll find this useful!

Leave a Reply

Your email address will not be published. Required fields are marked *