How to set a colorscheme in VIM?

After finding out the available colorscheme of VIM in your machine, the next step is to set a colorscheme.

Let’s assume that you have the following colorschemes available

  1. darkblue
  2. blue
  3. dessert

Now to set the colorscheme to blue

$ vim filename.txt

Enter the following in Normal mode

:colorscheme blue

As you can see the syntax for setting a colorscheme is

:colorscheme scheme_name

Note that if you enter a scheme name which is not available, you will get the following error

:colorscheme abc

E185: Cannot find color scheme abc

You can change a colorscheme using the same command.

Note that when you change a colorscheme by the above method, it is for a particular session only. Once you exit, you will lose the change. Read How to change a VIM colorschme permanently?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s