Why don't most vim color schemes look as nice as the screenshot when I use them?

Tanky Woo picture Tanky Woo · Mar 23, 2012 · Viewed 46.4k times · Source

I have downloaded many vim color schemas and tried them out, but many of them don't look like the official screenshot.

For example, vim's own color schema - desert should look like this: desert color schema

But in my vim, many colors won't display, for example the background. my vim color display

But some color schemas work correctly.

Why is that?

In the: Edit-> Profile Preferences -> Colors, I select the "use colors from system theme"

Answer

Michael Berkowski picture Michael Berkowski · Mar 23, 2012

Many colorschemes are designed for 256 colors, which is significantly better than a standard 8 color terminal. To make that work, you need $TERM set to a 256 color terminal like xterm-256color.

If you have a 256 color capable terminal (looks like you do from your screenshot if that is Gnome Terminal), set the $TERM to xterm-256color and enable 256 colors in your vimrc with something like:

if $TERM == "xterm-256color"
  set t_Co=256
endif

The Vim wiki has some tips on setting the correct $TERM for different terminal emulators. The easiest way to test this out quickly is to do

TERM=xterm-256color vim 

This will not make colorschemes designed for GUI vim fully compatible with terminal Vim, but will make 256-color colorschemes work, and those are a giant improvement over the standard 8 color colorschemes.