Thursday, October 20, 2016

Three Minutes Daily Vim Tip: Setting to Preloaded Colors

Vim comes with some color schemes. It will save some hassle if you can find one that looks good. Here is how to try them!

First, locate pre-loaded colors. Usually the files are in /usr/share/vim/vim73/colors/ directory, assuming you have vim7.4. Try
$ find / -name desert.vim 2>/dev/null

/usr/share/vim/vim73/colors/desert.vim

Now you can search the directory
$ ls /usr/share/vim/vim73/colors/*.vim
/usr/share/vim/vim73/colors/blue.vim
/usr/share/vim/vim73/colors/darkblue.vim
/usr/share/vim/vim73/colors/default.vim
/usr/share/vim/vim73/colors/delek.vim
/usr/share/vim/vim73/colors/desert.vim
/usr/share/vim/vim73/colors/elflord.vim
/usr/share/vim/vim73/colors/evening.vim
/usr/share/vim/vim73/colors/koehler.vim
/usr/share/vim/vim73/colors/morning.vim
/usr/share/vim/vim73/colors/murphy.vim
/usr/share/vim/vim73/colors/pablo.vim
/usr/share/vim/vim73/colors/peachpuff.vim
/usr/share/vim/vim73/colors/ron.vim
/usr/share/vim/vim73/colors/shine.vim
/usr/share/vim/vim73/colors/slate.vim
/usr/share/vim/vim73/colors/torte.vim
/usr/share/vim/vim73/colors/zellner.vim

In vim, set the color by
:color desert

To set it as your default color, simply do
$ echo ":color desert" >> ~/.vimrc

Enjoy vim!

No comments:

Post a Comment