Search code examples
rubysyntaxcolorssublimetext2highlighting

Sublime Monokai Syntax Highlighting: How to color method calls and make the color different inside of interpolated strings


For Sublime's Monokai theme with Ruby, how do you

1) color method calls

enter image description here

(ie how do you make "generate_key" a different color.

2) make the color different inside of interpolated strings.

enter image description here

ie how do you make the 'puts "this is inside. Halp!" a different color?


Solution

  • For your second question, include this in your color theme (more info here):

    <dict>
        <key>name</key>
        <string>Embedded Ruby Source</string>
        <key>scope</key>
        <string>string source.ruby.embedded.source</string>
        <key>settings</key>
        <dict>
            <key>foreground</key>
            <string>#D01F1E</string>
        </dict>
    </dict>
    

    Resuling in:

    enter image description here

    For the first question, you may try this excelent tool to find out the keyword for method calls.