Sublime Forum

Plugin Update: Schemr (colour scheme switcher)

#1

Today I released an update to my plugin Schemr

This is a complete rewrite in order to move away from the “hacky” method I was using previously to update the command palette, as well as to improve the general elegance of the code. This version no longer pollutes the global command palette with all of the available colour schemes, but instead lists them in their own quick panel. I know some users may have appreciated having all schemes under the command palette and if there is demand for that behaviour then I’ll add a switchable setting.

New/updated/removed in this version:

  • Quick panel list can be opened with ctrl+alt+f5/super+alt+f5, or from “Schemr: List schemes” in the command palette

  • New commands to cycle forward/backward through schemes: ctrl+alt+f7/super+alt+f7 and ctrl+alt+f8/super+alt+f8

  • Removed the Reload Schemes command. All schemes are now refreshed upon using the quick panel or cycle commands

ST3 is fully supported. ST3 support is limited (see GitHub description) but is planned in the near future.

A similar update to my plugin Themr is also in the works and will be released over the weekend.

0 Likes

#2

Sublime Text 3 support has just been added, and fixes a bug preventing preferences being loaded.

Edit [no longer true]: Schemr requires that the .sublime-package file start with "Color Scheme - " so scheme authors should add schemes to the Package Control Channel repo as "Color Scheme - " if they would like their schemes to be usable with Schemr.

0 Likes

#3

Looking good so far, I’ve also been thinking about writing something like this long ago but never really started, and it seems I didn’t have to because your plugin exists for some time now.

One thing though: What about merging these two packages to one? Their codebase is really similar and I (for example) would not have to install both packages if I want both features.

And a feature idea that someone on the IRC brought up probably months ago: Pick a color scheme randomly.

Edit: on_highlight preview?

Edit2: I know of the Nil theme that it defines color schemes but its package is obviously named “Theme - Nil”. Might consider picking this up as an option too.

0 Likes

#4

Thanks for the feedback, FichteFoll

I have considered combining these plugins into one and may get around to it in the future. Right now it’s not planned however.

I recall someone talking about a randomise command as well. I’m sure it would be a fun little experiment for users who can’t pick a scheme so I’ll add that to my list of things to do.

on_highlight preview is an awesome idea! While it’s not possible in ST2, the quick_panel in ST3 will definitely support this feature. I’ll try and push this out tonight after work. Check back in ~8hrs :smile:

I realised during testing that some themes will package colour schemes in a subfolder which won’t get picked up by Schemr. For this reason I removed the requirement for package filenames to start with "Color Scheme - ". Now .tmTheme files will be detected wherever they are saved.

0 Likes

#5

Highlight preview was such a good suggestion that I decided to stop working in order to implement it.

Navigating up/down through your colour schemes will show the selected scheme. Press esc to cancel the quick panel and restore the original scheme. ST3 only.

0 Likes

#6

FYI, there is a hierarchy in sublime with plugins. You have your default packages (zipped), which I believe can be overridden with installed packages (zipped), then you have your unzipped package folder which can override both default and installed packages. I don’t know if yours accounts for this, but I had added a “set scheme command” so you could set a scheme and edit it in my ColorShemeEditor plugin, and I did this in order to only show logically available schemes. I don’t think mine properly handles the default/installed case, but I know it handles the default/installed/packages case (I kind of yanked it from one of my personal plugins, and then threw it in real quick with some adustments), I plan on fixing it the first case soon, but it is here if it helps: github.com/facelessuser/ColorSc … or.py#L259.

EDIT: looked at my code again, and I believe I am handling all cases (couldn’t remember if I was or not, but it looks like I am).

0 Likes

#7

I’ve recently changed my GitHub username and this is causing Schemr to not appear in Package Control’s plugin list. While I wait for the pull request to be accepted, you can still add the new repo URL through Package Control or download it manually from: github.com/benweier/Schemr

Sorry if this has caused any inconvenience.

0 Likes

#8

Latest addition: Favourites!

Thanks to Syntax Coloring for rolling his Cycle Color Schemes plugin into Schemr. His awesome contribution allows colour schemes to be added/removed as a favourite and adds new key bindings to display and cycle through favourites independent from all colour schemes.

Of course if Schemr isn’t your thing, you can get just the favourites functionality with the Cycle Color Schemes plugin which will continue to be available as a lightweight alternative.

0 Likes