Home Download Buy Blog Forum Support

Syntax Highlighting Mode, Ruby Symbol

Syntax Highlighting Mode, Ruby Symbol

Postby burlesona on Thu May 03, 2012 3:10 pm

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.
burlesona
 
Posts: 3
Joined: Thu May 03, 2012 3:00 pm

Re: Syntax Highlighting Mode, Ruby Symbol

Postby jbjornson on Thu May 03, 2012 3:21 pm

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.
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Syntax Highlighting Mode, Ruby Symbol

Postby jbjornson on Thu May 03, 2012 3:24 pm

...in OSX the shortcut should be super+alt+p or ctrl+shift+p (show_scope_name).
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Syntax Highlighting Mode, Ruby Symbol

Postby burlesona on Thu May 03, 2012 6:29 pm

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!
burlesona
 
Posts: 3
Joined: Thu May 03, 2012 3:00 pm


Re: Syntax Highlighting Mode, Ruby Symbol

Postby quodlibet on Thu May 03, 2012 9:08 pm

@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: https://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:
https://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.
quodlibet
 
Posts: 508
Joined: Sat Jun 18, 2011 5:53 pm

Re: Syntax Highlighting Mode, Ruby Symbol

Postby burlesona on Sat May 05, 2012 10:24 pm

@quodlibet: Awesome, thanks for the links, and if you get a chance to post your theme I'll be excited to see it!
burlesona
 
Posts: 3
Joined: Thu May 03, 2012 3:00 pm


Return to Technical Support

Who is online

Users browsing this forum: jotis and 27 guests