chriskempson/base16-builder — pull request #130 by cskeeters (2014-03-26 15:54:24+00:00)
Title: colorscheme will change colors in some terminals

If a user sets up base16-vim, they can run :colorsheme base16-greenscreen and see the result, but only if they are in gVim or MacVim.

In a terminal, the change doesn't take effect right away because the ANSI colors 0-20 have to be reset. This can be done with a base16-shell script, or through one of the terminal color configuration files produced by this builder (base16-iterm2). Using either of these two methods will require the user to take an extra step after using the :colorscheme command so the user can't switch schemes immediately. Also, if a user wanted to use different color schemes for different file types and have them load with autocmds, this would be impossible.

This small change allows :colorscheme commands to work in terminals (that work with base16-shell) the same way they work in gVim and MacVim.

For this to work, the user must take extra steps after installing base16-vim (after this change is committed of course)

1) The user must clone base16-builder and run ./base16 to populate the output/scripts folder. (they could also clone base16-scripts, but the color schemes not all the same as the ones in the base16-builder repo.)
2) The user must add extra settings in their .vimrc file:

# Enable the functionality and set the path
let g:base16_shell_path = $HOME."/base16-builder/output/shell"
# Return the terminal to a known color state on vim exit (optional)
autocmd QuitPre * colorscheme base16-default
# or autocmd QuitPre * execute "silent !/bin/sh ".g:base16_shell_path."/base16-default.dark.sh"

I understand that this is a complex setup. I don't know exactly how base16-vim is built (I assume from the output of base16-builder). It's possible that the base16-shell script could be included somehow so that the user wouldn't have complete step 1 above. If you look at this and want to suggest another direction, let me know and I may be willing to make some more changes.