Thursday, August 2, 2012

Vim not showing color

Yes, awkward title, but I couldnt think of some better title. Also, these are the exact words that i typed on google to search why i opened the file and I saw my .c file "all black and white"

check your vimrc file. Does it exist? (Whats vimrc? - google it or wait for my next post)

most probably its not there.

1> Create it (if its not there)

bash$ touch ~/.vimrc

2> open vimrc

bash$ vim ~/.vimrc

3> type the following on top of it

syn on

4> close the file.

5> Test it out by opening any .c or .sh file. See the difference.

Note: if vimrc doesnt exist, vim behaves like vi, its predecessor editor that has limited features as compaired to vim. Hence you do not see your file colored when you open the file using vim.

More about vimrc in the next blog.