Vim how to change color scheme

Jark Kween

Vim is one of the most popular text editor on Linux and an excellent choice for developer and administrator when it comes to handle tasks such as edit configuration files or even use it as a code editor.

Change Vim Color Scheme

The default color schme for Vim is looks good in most cases. However if you wish to change to other color schme then you can do it with ease. In Vim, switch to command mode by typing the : (make sure you're not in the edit mode or you'll insert the character to the current editing position) and run the following command:

:colorscheme desert

This will set the color scheme to desert for the current session. If you quit Vim and use it for the next time the default color scheme will be used again.

To try other color scheme by typing :colorscheme followed by Space. Then hit the Tab key to switch between color them.

You can also use the following command to save key stroke:

:colo desert

Change Vim Color Scheme Permanent

To change Vim's color scheme permanently, you need to edit the configuration file .vimrc. This file is located at your home directory ~/.vimrc. Now open it by run the following command on terminal:

vi ~/.vimrc

Then insert the following line:

colorschme desert

Change desert to the color scheme you want to use then save the file and quit Vim. Now if you open Vim again you'll see the new schme will be used.

List All Installed Scheme

If you want to see a complete list of installed color scheme for your Vim editor then switch to command mode and type in :colorscheme then press the Space followed by Ctrl + D.

After that hit Enter, you'll see a list of installed color scheme:

blue       darkblue   default    delek      desert     elflord    evening    koehler    morning    murphy     pablo      peachpuff  ron        shine      slate      torte      zellner