vim-colorscheme-switcher icon indicating copy to clipboard operation
vim-colorscheme-switcher copied to clipboard

Five commits that made a useful plugin even more useful for me (Scheme whitelisting, BG toggle, more)

Open cameronbrown opened this issue 8 years ago • 1 comments

Very useful plug-in, thanks for sharing!

I have a few commits you may be interested in.

Scheme whitelist option

I found it a little daunting to scroll through the 80 color schemes that came in a huge bundle I have, and I didn't want to create a giant exclude list, so I created a new option (colorscheme_switcher_include) to limit the selection to the schemes I like best. In my vimrc, I can then set these lists differently for graphical and terminal vim, which is pretty handy. If someone wanted to get fancy they could even define different sets for different times of day.

Scheme set toggle (light/dark)

I really like the colorscheme_switcher_keep_background option, since I generally want to choose from all light or all dark backgrounded schemes depending on environmental light. But what was missing was a quick way to switch between light and dark sets when needed. So I added a command (ColorSchemeToggleBG) to toggle between the two sets and mapped it to <C-S-F8>.

Let vim calculate background values

When cycling through color schemes with the colorscheme_switcher_keep_background option turned on, I noticed it would often skip schemes it should have cycled to. I figured out that some of the schemes didn't seem to be setting the background value when they load. But if you do set background& after the color scheme has loaded, vim seems to do a good job of correctly setting the background value, at least for all the schemes I was able to try (~80).

Other

  • Plugin will now remember the last color scheme it loaded so that if you manually load a color scheme without telling the plugin, it can resume cycling from where it left off rather than starting over again from the beginning of the list. Good if you have a long list.
  • Renamed commands to all start with the common prefix "ColorScheme." This organizes the namespace and makes command tab-completion better. Old command names are still defined but considered deprecated.
  • Changed reported color scheme list index so it goes from (1/n) to (n/n), rather than (0/n) to (n-1/n).

These five commits are pretty clean, so cherry picking should be easy if you want to be selective. Let me know if you'd rather have separate PRs based from your head. Doc updates included.

cameronbrown avatar Aug 16 '16 06:08 cameronbrown

I second this! I'd like to use the plugin for switching between just 2 schemes---light and dark---, so a whitelist/includeonly option would be perfect.

dajuno avatar Nov 04 '16 12:11 dajuno