Sublime Forum

How to modify a default color scheme?

#1

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

0 Likes

#2

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:

<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) + (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:

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

You can find sample .tmTheme files here:

Packages\Color Scheme - Default

The “Packages” folder is explained here:

sublimetext.info/docs/en/basic_concepts.html

0 Likes

#3

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!

0 Likes