Vim Colorschemes

Jul 4 2009

Here's a small tip for burgeoning Vim (VI Improved) users. Vim supports various colorschemes in its colorized editing mode. If you don't like the default syntax highlighting colorscheme that Vim uses, you can change it easily by running a command like this (within Vim):

:colorscheme koehler

The :colorscheme command takes one argument: the name of the colorscheme. Above, I am setting the syntax highlighting colorscheme to the koehler scheme. At any point, I can change it back to the default by running: :colorscheme default <!--break--> So how many colorschemes are there, and how can I find out about them? You can view a list of colorscheme files in /usr/share/vim/vim72/colors/. Other than the README.txt file, all of the rest are colorscheme files.

$ ls -1 /usr/share/vim/vim72/colors/
README.txt
blue.vim
darkblue.vim
default.vim
delek.vim
desert.vim
elflord.vim
evening.vim
koehler.vim
morning.vim
murphy.vim
pablo.vim
peachpuff.vim
ron.vim
shine.vim
slate.vim
torte.vim
zellner.vim

You can switch to any of these using :colorscheme.

Want to craft your own? The syntax is simple. Take a look at the elflord.vim file for a good (short) example.