Home Download Buy Blog Forum Support

Best way to customize Theme / Colors / Syntaxhighlighting

Best way to customize Theme / Colors / Syntaxhighlighting

Postby garvin on Tue Jan 10, 2012 9:06 am

Hi!

Yesterday I started using SublimeText2 (replacing my Textwrangler on OSX) and am loving the customizability so far. Great work!

I want to use a dark color theme and find "All Hallow's Eve" basically matching for a start. However I am missing more distinct colors. I am mostly using PHP syntax highlighting and specifically want to adjust:

- Color of $variable to be distinct
- Color of CONSTANTS to be distinct
- Color of PHP functions (like htmlspecialchars()) and self-defined functions to be the same - so basically function() should look the same, no matter if it's built-in or my own function
- HTML tags within PHP variables should have a different color for the <key> and the content within <key>...</key>

Now how do I start?

It seems that PHP.tmLanguage is used to assign distinct keys for each syntax specification, and then a .thTheme file can use that key for styling? The PHP.tmLanguage mentions that HTML.tmLanguage is actually used, so where/how do I look for the names of the syntax definitions that I mentioned earlier?

Thanks for any pointers,
Garvin
garvin
 
Posts: 3
Joined: Tue Jan 10, 2012 8:55 am

Re: Best way to customize Theme / Colors / Syntaxhighlighting

Postby BestGreek on Tue Jan 10, 2012 9:59 pm

I made a custom themed that was originally a copy of the them "Solarized (Dark).tmTheme" that comes with ST2. The main reason I picked that theme is it seems to have good php support. From what I can tell different themes support different languages better then others depending on how specific the syntax matching rules are. Just copy the "Solarized (Dark).tmTheme" file and rename it to anything, then you can edit it. Once your done just select it as your new them.
BestGreek
 
Posts: 66
Joined: Wed Dec 14, 2011 9:02 pm

file specific Syntax highlighting

Postby S0und on Wed Mar 07, 2012 1:49 pm

I'm bumping this thread with a syntax highlight related question.

So my question, is there any way to set a file name specific syntax highlight color scheme?

I have a script that i use for daily work, exp.: workscript.ahk When i adding new features to the script i use a new file like: workscript_beta.ahk. But sometimes i got confused - since the code mostly identical - and sometimes i'm changing the "wrong" file, aka. the normal daily work file. Is that possible to use 2 different color scheme for each file?
S0und
 
Posts: 70
Joined: Wed Oct 28, 2009 4:12 pm

Re: Best way to customize Theme / Colors / Syntaxhighlighting

Postby jbjornson on Wed Mar 07, 2012 2:02 pm

On a given view, you can set the color_scheme setting for a specific file, but it won't be remembered if you close it and open it again. Maybe you could save this as a plugin and make sure you execute it each time you open your productive file...
Code: Select all
view.settings().set('color_scheme', 'Packages/Color Scheme - Default/Solarized (Dark).tmTheme')
jbjornson
 
Posts: 348
Joined: Tue Oct 27, 2009 4:25 pm
Location: Zurich, Switzerland

Re: Best way to customize Theme / Colors / Syntaxhighlighting

Postby S0und on Wed Mar 07, 2012 4:48 pm

jbjornson wrote:On a given view, you can set the color_scheme setting for a specific file, but it won't be remembered if you close it and open it again. Maybe you could save this as a plugin and make sure you execute it each time you open your productive file...
Code: Select all
view.settings().set('color_scheme', 'Packages/Color Scheme - Default/Solarized (Dark).tmTheme')


This is good enough, thanks!
S0und
 
Posts: 70
Joined: Wed Oct 28, 2009 4:12 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 15 guests