Sublime Forum

Key for adding coloring to string interpolation

#1

Hey guys!

Does anyone know if it’s possible to specify a key in the tmBundle’s (for example, for Monokai) that would make the “#{foo}” show up as a different color in a string?

s = “Hello there #{foo} how are you?”

That would be helpful for spotting string interpolations. Right now the string has the same color regardless of whether or not it has substitutions.

Thanks!

0 Likes

#2

Actually, to be more specific, I just want the #{} characters to have a specific color, not the text within.

Thanks!

0 Likes

#3
<dict>
	<key>name</key>
	<string>Embedded Ruby Punctuation</string>
	<key>scope</key>
	<string>string punctuation.section.embedded.ruby</string>
	<key>settings</key>
	<dict>
		<key>foreground</key>
		<string>#F92672</string>
	</dict>
</dict>

You could add a section like that to the Packages\Color Scheme - Default\Monokai.tmTheme file, adjusting color to taste.

0 Likes

#4

That worked great, thanks!

0 Likes