Friday, September 2, 2011

Forcing Vim's syntax highlighting (for odd file extensions)

I often tend to keep backup copies of my C/C++ source files with odd extensions (i.e. something that does not end with CC or C). If these files are opened with Vim, they wouldn't be recognized as they should, which means my CTAGS extension and colored syntax highlighting would both refrain to work. The quick solution to this problem is to tell Vim explicitly about the file type. Here is how one can do it:
:setfiletype c
More information on it, as always:
:help setfiletype

0 comments:

Post a Comment