Home Download Buy Blog Forum Support

Color scheme help

Color scheme help

Postby bfarber on Mon Jan 16, 2012 6:54 pm

I customized my own color scheme to better match what I was used to with other editors. I prefer light background + dark text, and had certain other preferences (again, more to do with familiarity than anything). I'm not *that* familiar with the color scheme structure and how it all works and ties in together in Sublime, so I've hit a minor issue I'd like to resolve. I'm sure it's possible, I just don't know how.

(As an aside, I'm a PHP developer, so that's all I care about here)

Sublime automatically picked up on phpdoc-style comments, which was nice. Thing is, it picks up php symbols inside the comments and styles them according to the symbol styling scheme. Here's an example

Image

"private" is being styled according to the keyword styling I've applied (you can see it in use right below the comment), making it bold and blue. It *is* italicized (which is only done for comments), so the italic styling is being applied but not overriding the bold styling. It doesn't appear to make a difference what order the XML elements are in inside the file (I tried moving the comments definition to the end of the file, figuring it might override earlier definitions).

Here is my comment styling definition - what should I change to get the symbols inside comments to style as a regular comment? Is it possible? Note that I'd still like "access", "var", etc. styled as they are now (blue, italic, not bold).

Code: Select all
      <dict>
         <key>name</key>
         <string>Comment</string>
         <key>scope</key>
         <string>comment</string>
         <key>settings</key>
         <dict>
            <key>fontStyle</key>
            <string>italic</string>
            <key>foreground</key>
            <string>#488C03</string>
         </dict>
      </dict>


Further, is there any documentation I can refer to that describes all of the color scheme options? I think I'm looking for a breakdown of all the scopes available, as well as any settings (e.g. selection, lineHighlight, etc.), as that would help me know *what* I can style exactly. I just copied an existing scheme and tweaked it to my tastes, so I'm sure there's a ton more options available that I just don't even know about.
bfarber
 
Posts: 9
Joined: Fri Jan 13, 2012 10:42 pm

Re: Color scheme help

Postby C0D312 on Mon Jan 16, 2012 9:00 pm

Colorschemes style based on selectors. You can view what selectors are applied to a specific element by using the show_scope_name. The keybinding defers between operation systems so just to a quick find in your Default Keybindings File. When you press that keybinding, it will list all the selectors that apply to where your cursor is in the document.

tmThemes work kind of like css... except the styling is added in reverse. Try moving the comments up toward the top. It should fix your problem.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Color scheme help

Postby bfarber on Wed Jan 18, 2012 12:32 am

Thanks for the tip!

Unfortunately, moving the comments declaration up didn't do anything to help.

Your tip on finding the scope helped immensely, however. I found that it is:

text.html.basic source.php.embedded.block.html comment.block.documentation.phpdoc.php storage.modifier.php

Using this, I tried to modify the comments declaration to scope "comments, comments storage.modifier.php" and this changed the color, but left the keyword bolded (despite having a fontStyle defined in this declaration of italic - I didn't know how to tell it to use normal font weight).

Ultimately I changed the 'storage' declaration to

Code: Select all
<string>storage - comment storage.modifier.php</string>


This resolves the issue perfectly. Thanks!
bfarber
 
Posts: 9
Joined: Fri Jan 13, 2012 10:42 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 22 guests