Sublime Forum

Syntax Highlighting Mode, Ruby Symbol

#1

I’ve been trying to modify the Twilight theme to make ruby symbols blue instead of red. I started by copying the Twilight.tmTheme file, but in looking through it I cannot find any entry that seems to correspond to symbols in ruby. I tried changing every color code in this file and none of them successfully changed the color of symbols…

What is the key for this?

Also, are there some docs available about how to make a color theme, or what definitions to use, etc. Is there a blank starter template that has all the relevant definitions in it?

Last thought, a color-picker for editing these theme colors would be super helpful. This doesn’t have to be a seperate interface, just the OSX built-in color picker would be great if sublime would let me pull it up.

0 Likes

#2

While the cursor is on a symbols in a ruby file, press “ctrl-alt-shift-p” and the scope (of what is under the cursor) will be shown in the status bar. This should help you to see what setting is controlling the coloring of this scope.

0 Likes

#3

…in OSX the shortcut should be super+alt+p or ctrl+shift+p (show_scope_name).

0 Likes

#4

Got it… the shortcut is command-option-p on Mac.

Second question, are there docs about how to write a custom syntax highlight theme? I noticed some stuff where people were using JSON instead of XML, but I haven’t been able to find any docs about how to create a theme from scratch or what formats you can use.

Thanks!

0 Likes

#5

docs.sublimetext.info/en/latest/ … xdefs.html

Also, manual.macromates.com/en/language_grammars

0 Likes

#6

@burlesona, on your 2nd question:

For ST2 to be able to read a theme, it must be in the XML format you’ve been looking at. The reason to convert XML files to JSON is that it’s less cumbersome to write. I use this plugin for the back-and-forth conversion: github.com/facelessuser/PlistJsonConverter

I think the Monokai theme that ships with ST2 is a pretty good place to start with as it’s not too long and does not include a lot of syntax specific stuff.

Also, I find the following plugin very useful in picking out scopes:
github.com/facelessuser/ScopeHunter

Edit: I’ve been working on putting together a theme from scratch. I’ll see if I can clean up what I have and post it over the weekend.

0 Likes

#7

@quodlibet: Awesome, thanks for the links, and if you get a chance to post your theme I’ll be excited to see it!

0 Likes