The vim editor can take advantage of color schemes to help emphasize specific elements of code.
Adding a theme
First make sure you have vim installed and not just vi. You can test this by typing ‘vim’ at the command line and see if the editor loads.
Add the following to ~/.vimrc to make desert the default theme.
After restarting your shell (logout and login again again) your vim sessions will have the desert color scheme. Desert is the scheme that’s pictured at the top of this article. Some other stock themes are:
Modifying a theme
If you want to change just a specific color in a theme you can do so by editing the theme itself. For instance if we want to change the comments in the desert theme to green we can do the following.
Search and replace the following two lines so they now say green:
Adding even more themes
Tired of the default themes? Need something more? Try some of these other themes:
Other vim settings I use
Unrelated to color themes but related to vim settings. Here are the other settings in my ~/.vimrc file.