If wanting to try an alteration to a Vim colorscheme it’s usually nice to work with the author of that colorscheme to improve it. But if wanting to try it first and road test it, this is a good way to do it. First:
Get the plugin
For this to work a plugin is needed. Arch Linux users can install it from the Arch User Repository: vim-plugin-aftercolors. This plugin enables the
vim/after/colors directory where edits can be put that override an installed colorscheme values. The directory to do this in is located at
~/.vim/after/colors by default; create it if it doesn’t exist.
Overrides for the colorscheme resemble that which are in the colorscheme file itself. It is usually useful to read the actual colorscheme file to get ideas of what to do: authors sometimes leave notes and one can see all the settings. To try a new setting, put it in a file here that matches the colorscheme name (e.g.
~/.vim/after/colors/desert.vim). To learn more about how to set and test them in an easier manner, read the next section. When an edit is saved here, the colorscheme can be reloaded (if say in another terminal) by doing:
To try new settings immediately, Vim has got built-in, on-the-fly, colorscheme alteration support (using the
highlight command). List all the colorscheme settings with:
Or to see a specific setting (tip: have wildmenu enabled to see tab-completions):
To temporarily change a setting, enter the value:
:highlight Cursorline ctermbg=4
To know what color to use, the terminal color number will need to be obtained. Here’s a couple links with script and desciptions: link1, link2; alternately, my own script is available (it prints to terminal the color and number, though is meagerly tested): termcolor.