How To Turn Color On and Off in Vim

Color coding different types of words, depending on the programing language you are using is an extremely useful feature of vim. Vim is smart enough to know that when you are editing a .js JavaScript file, then you want words such as 'function' and 'for' to be highlighted and stand out. This coloring of certain key words makes code much easier to read and edit. vim calls this feature 'syntax'.

To turn on syntax in vim just type :syntax on in the file you are editing. To turn color highlighting off just type :syntax off inside vim.

To permanently turn syntax color coding on edit/create the .vimrc file. vi ~/.vimrc and ensure the file contains the line syntax on.

Be sure to check out the available vim addon scripts. There's a ton of them out there, just search and set the 'type' to syntax. If you code in a particular language, try searching for that language specifically.