Created
April 17, 2014 18:14
-
-
Save drazen/11002364 to your computer and use it in GitHub Desktop.
Subdued end keyword in sublime text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Although Ruby is not a whitespace significant language, multiple "end" keywords in the keyword syntax color highlighting can be glaring. If you're consistent with indentation... a loudly colored "end" keyword doesn't add much. So lets tone down the color on the "end" keyword in sublime text. | |
In ruby.tm-language: | |
replace | |
<string>(?<!\.)\b(BEGIN|begin|case|class|else|elsif|END|end|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!])</string> | |
with | |
<string>(?<!\.)\b(BEGIN|begin|case|class|else|elsif|ensure|for|if|in|module|rescue|then|unless|until|when|while)\b(?![?!])</string> | |
and add the following XML stanza: | |
<dict> | |
<key>comment</key> | |
<string>isolate 'end' so we can target it for subdued syntax hightlightitn</string> | |
<key>match</key> | |
<string>(?<!\.)\b(END|end)\b(?![?!])</string> | |
<key>name</key> | |
<string>keyword.control.end.ruby</string> | |
</dict> | |
Now in your theme file(s) ex. Tomorrow-Night.tmTheme, add the stanza: | |
<dict> | |
<key>name</key> | |
<string>Subdued end</string> | |
<key>scope</key> | |
<string>keyword.control.end</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#444444</string> | |
</dict> | |
</dict> | |
And now you can at least pretend Ruby is whitespace significant ;-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment