I've always been a bit of a chameleon when it comes to colors in my terminal. I am never settled on just one scheme. Sometimes I'll go a couple weeks on a dark scheme like railscasts, just to switch over to solarized-light.
The switching back and forth was pretty frustrating. Each time I switch, I have to update my
~/.zshrc file to load a new colorscheme. THEN I'd update my
~/.vimrc to match. I'd also have to restart my current vim sessions so the editor runs with the new scheme.
This was all pretty annoying until I discovered:
base16-shell and base16-vim
Quick, check out the repos for these projects:
I have both these packages set up on my machine, it allows me to do this:
Steps to accomplish this amazing workflow:
1: install base16-vim
vim-plug to handle my vim dependencies and strongly suggest anyone else use the same. Put this in your
and run something like
vim +PlugInstall +qa and you should be up and running! This will install all the base16 colorschemes for use in vim.
2: install base16-shell
base16-shell with the auto-completion. This is all lifted from the repo's README linked above:
git clone https://github.com/chriskempson/base16-shell.git ~/.config/base16-shell
Next (for autocompletion) place these lines in your
BASE16_SHELL=$HOME/.config/base16-shell/ [ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
3: Add config to your vimrc
Finally, you'll need to update your
~/.vimrc to include a file that gets created/updated from
base16-shell. Again, lifted from the great README in the repo:
if filereadable(expand("~/.vimrc_background")) let base16colorspace=256 source ~/.vimrc_background endif
And there you have it!
Base16-shell will set up your colors, and modify a vimrc file to upadte your colorscheme. As long as you're sourcing this file in your ~/.vimrc, you'll be able to automatically see the updates to your colorscheme in all running vim instances!
Subscribe to BrownTree Labs
Get the latest posts delivered right to your inbox