, , ,

Change the default color scheme in VIM editor

Using VIM and seeing a very dark blue hard to read font? Change the default colorscheme to something easier on the eyes…I prefer Koehler.

This is what the original color scheme looks like with an example script/file…very hard to read and I don’t like to squint…

With using vim, it’s possible to change it anytime by typing :colorscheme <space> <tab> (or type :colo as a shortcut):

Changing the color scheme to Kohler makes that same script look better, much easier to read, and syntax is highlighted different colors:

However,changing the colorscheme in the editor only changes it for that vim session and will revert back to the previous setting after exiting.

There is an option to permanently change that color scheme by editing the .vimrc file to contain a preferential theme.

Let’s do that!

sudo vim /etc/vim/vimrc

Simply navigate to the last line, insert a few lines, add a comment (optional) and a directive for colorscheme:

colorscheme koehler

Or your choice of theme…blue, darkblue, default, delek, desert, elflord, evening, industry…there’s a lot of options if you search for them.

Do a :wq and the next time VIM is opened, the theme will be what is set in the .vimrc file.

Thanks, and that’s it, easy peasy. Comment below if that helped you out!

Leave a Reply

Your email address will not be published. Required fields are marked *