Home Download Buy Blog Forum Support

How to modify a default color scheme?

How to modify a default color scheme?

Postby roblight on Fri Jul 08, 2011 2:36 am

Hi folks,

I've been checking out SL2 on my Mac and I'm really liking what I see! Great work so far.

I'm having trouble finding any documentation or posts about how to make modifications to a default color scheme. Can someone please point me in the right direction?

Thanks so much,
Rob
roblight
 
Posts: 13
Joined: Fri Jul 08, 2011 2:25 am

Re: How to modify a default color scheme?

Postby guillermooo on Fri Jul 08, 2011 4:51 am

Color schmes are XML files in the Plist format and have a .tmTheme extension.

You need to understand scopes (essentially, named regions in the text buffer). To target a scope in a color scheme, you use an entry like this:

Code: Select all
      <dict>
         <key>name</key>
         <string>Comment</string>
         <key>scope</key>
         <string>comment</string>
         <key>settings</key>
         <dict>
            <key>foreground</key>
            <string>#75715E</string>
         </dict>
      </dict>


... which makes your eyes bleed after long exposure to it, by the way.

I don't know why name (key) + <Actual name> (string) pairs are needed, but it seems all entries have it.

scope (key) + <scope_name> (string) pairs determine what you are changing (the scope "comment" in this case).

settings (key) contains the actual "color information". In this case, the scope "comment" text --or "foreground" (key)-- will be highlighted with #75715E (and "comment.single.line", "comment.multi.line", "comment.foo"...) .

You can read up on scopes here:

http://sublimetext.info/docs/en/extensi ... xdefs.html

You can find sample .tmTheme files here:

Packages\Color Scheme - Default

The "Packages" folder is explained here:

http://sublimetext.info/docs/en/basic_concepts.html
guillermooo
 
Posts: 718
Joined: Thu Jul 23, 2009 9:06 am

Re: How to modify a default color scheme?

Postby roblight on Fri Jul 08, 2011 2:40 pm

Thanks so much for the info!

What I ended up doing was making a copy of the color theme in the Users area, renaming it and changing it to my liking.

Thanks again!
roblight
 
Posts: 13
Joined: Fri Jul 08, 2011 2:25 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 14 guests