Sep 132010
How to set the filetype in Vim
Answer:
When you created a new file by using the command vi, vim does not know the file type unless you save the file with a specific extension, e.g. test.c, or sometimes when the extension cannot be recognized by vim, you need to set the file type manually in command mode - pressing Esc + :
:set filetype=c
That is it.