Sublime Forum

Full Sublime color theme

#1

Hi,

I would like to create my own syntax highlighting color theme, but I could not found any documentation regarding to these themes.

I have found this online theme generator. It would be great as a base, but my only problem is that it does not include all of the features on the left panel. E. g. if I upload an existing theme to edit, it has more scopes to color, and other themes have less.

So, where can I find all of the existing scopes? Is there a “template” theme available somewhere, which is fully documented and contains all of the configurable scopes?

0 Likes

#2

the scopes come from .thLanguage files, and there is no rule how to name scopes, yet there are some common techniques. You might want to check TextMate’s manual on this

0 Likes

#3

Sublime Text 2 and Textmate .tmTheme files are totally compatible with each other? And also with Sublime Text 3?

0 Likes

#4

Yes,
.tmTheme files are totally cross version for sublime and obviously fully compatible with textmate (they were born for tm…).
As valerij_ said, scopes are defined per language in their respective .tmLanguage’s files, so basically you can have as many scopes you want/need as far as you set them in the language file, thus there isn’t a fixed list of scopes.
I can point you to Thomas Aylott’s “Brilliance Black” theme, it’s one of the more complete color schemes I found on the web.

hope it helps :wink:

0 Likes

#5

Thank you guys for the help! :wink:

0 Likes

#6

The scopes are actually the easiest part of this equation.

The basic outline is this: manual.macromates.com/en/language_grammars

Use ScopeHunter to get the scope under the cursor:
github.com/facelessuser/ScopeHunter

(There are other options out there, but SH is a must for designing color schemes.)

Now, creating color schemes for Sublime/TextMate/etc. is a massive hassle because writing in the defualt PLIST (an XML format, basically) is a PITA.

To alleviate this you can use SerializedDataConverter to write the scheme in JSON or YAML and convert it to PLIST:
github.com/facelessuser/SerializedDataConverter

There’s a new plugin that allows you to write in CSS or Sass and convert to PLIST:
github.com/FichteFoll/CSScheme/

I think using Sass is a good solution, because it’s readable and allows functions to tweak colors.

I have converted a theme I’ve been using for a few years now to Sass and am in the process of abstracting it, so it can be used as a base for others. It’s not very well documented yet, but I’m actively developing it, and it might help you in your own explorations:
github.com/alehandrof/Writerly/

If you understand Sass the “_better_base.scss” file contains the guts of the scheme:
github.com/alehandrof/Writerly/ … -base.scss

It will give you a good sense of what the common scopes are – the scheme was originally based on the default ST2/3 scheme (Monokai).

And, in case it’s useful, this is the same scheme (more or less) in JSON:
github.com/alehandrof/Writerly/ … Theme.JSON

Hope this helps,
Alex

0 Likes

#7

Aww, thanks! This is really helpful!

0 Likes