Sublime Forum

An easy way to extend schemes?

#1

First, the direct problem I was trying to solve:

I’ve been using the default Monokai for a while and I’m generally very happy with it, but it seems to have weak support for Markdown syntax highlighting. The whole file appears mostly in black and white, as though it were using Plain Text syntax highlighting. Looking at the default color schemes and using the number of occurrences of the word “markup” in each one as a rough proxy for how well each supports Markdown highlighting. The results were all over the board:

$ for i in *.tmTheme; do echo $(grep -ic markup $i) $i; done | sort -rn 20 Sunburst.tmTheme 18 Dawn.tmTheme 13 Cobalt.tmTheme 12 Mac Classic.tmTheme 12 Eiffel.tmTheme 8 MagicWB (Amiga).tmTheme 7 Twilight.tmTheme 6 Espresso Libre.tmTheme 5 Solarized (Light).tmTheme 5 Solarized (Dark).tmTheme 3 Pastels on Dark.tmTheme 3 Monokai.tmTheme 3 Monokai Bright.tmTheme 0 iPlastic.tmTheme 0 Zenburnesque.tmTheme 0 SpaceCadet.tmTheme 0 Slush & Poppies.tmTheme 0 LAZY.tmTheme 0 IDLE.tmTheme 0 Blackboard.tmTheme 0 Amy.tmTheme 0 All Hallow's Eve.tmTheme

The results pretty well match my hypothesis: “Amy” highlights almost nothing, and “Sunburst” has different foreground/background colors, bold, italics, etc.

Now, for the indirect problem I’m wanting to solve: providing overrides to color schemes without making copies of them and patching them myself. Is there a way to say “use Monokai but with these extra settings”, or even “use these settings as defaults for all schemes that don’t define them themselves”? Again, I don’t want to maintain my own forks of every scheme I occasionally use, and it’d be extra-sweet if I could refactor my overrides out into their own settings file so that I could easily apply them to any new scheme that comes out. Is that possible?

1 Like

#2

Why not just copy the theme and make your additions?

0 Likes

#3

Because

  1. Now I have to maintain a separate branch of my own scheme that differs from upstream. If upstream changes, I have to merge my local branch. As much as I love and use Git daily, that’s an extra hassle I’d prefer to avoid.

  2. Suppose I really
    want, say, function names to be bold and underlined regardless of the scheme. It’d be so nice to have a standard way to tell ST2 “load the named scheme first, then apply my personal scheme overrides on top of it”.

Basically, I’d ideally like ST2’s schemes to work like CSS.

0 Likes

#4

Really good point, while Sublime Themes (not color schemes) are customizable (see github.com/buymeasoda/soda-them … tomisation) by making a file with similar name in User folder, color-schemes are not. which is a pity. I also like to customize my color schemes and make them work better with other file formats that they’re not designed for. I do like to see this feature in near future.

In the meanwhile, I have sort of a solution for you. You can have filetype specific color schemes in sublime. So just use something that has a really good support for markdown (like sunburst, mine is Mac Classic, since it has white background and I like to read/write markdown on a white page :stuck_out_tongue: ) and stick to Monokai for code.

0 Likes

#5

You know, I hadn’t really considered that. It doesn’t really fix the general problem, but that goes a long way toward solving this specific need. Thanks for the suggestion!

0 Likes

#6

Hi,

Has there been any progress in this? I also would like to extend a given color theme without touching it. In my case I use cobal2 and I want to add support for some custom syntaxes. I dont want to modify cobal2.tmTheme since I would like to keep getting the updated without having to mantaing a different, custom branch

Thanks,
A

0 Likes

#7

nice idea! I subscribe :smile:

0 Likes

#8

Color schemes don’t change all that often, most people end up customizing whatever base theme they like.

I’ve been trying to build a framework for adding components to themes, but it’s going to be a bit, until I have anything to release. t’s built using SCSScheme, which allows you to use Sass for writing color schemes.

The repo is here:
github.com/alehandrof/Writerly

It doesn’t actually make any mention of this. But you can see what I’m trying to do here:
github.com/alehandrof/Writerly/ … components

Alex

0 Likes