Change color scheme in Vim

Instead of displaying in just black and white text and background combo, Vim can display in other colors as well. This can be done by changing the color scheme.

To change the color scheme, follow any of the following methods;

Command mode (temporary)

While in Vim, press the ESC key to get into command mode. Typing the following command followed by Enter will change the color scheme to blue.

:colorscheme blue

Press the TAB button to cycle through the available color schemes.

The following color schemes are available;

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

Edit configuration file (permanent)

To make the setting permanent, add the following line to /etc/vimrc or ~/.vimrc

colorscheme blue

Sign up for Vim Masterclass and many other great courses on Udemy to learn more.

Vim Masterclass

Mastering the vi and Vim Editors on the Linux, Unix, Mac, and Windows Operating Systems!

Written by Mohd Shakir Zakaria.

Last updated on 2019-02-12.