How do I make vim use syntax=cpp
for *.h *.H *.C files? What line(s) should I add to vimrc?
views:
48answers:
1
+1
A:
Try something like:
if has("autocmd")
" Enable file type detection
filetype on
autocmd BufNewFile,BufRead *.h,*.c setfiletype cpp
endif
I am not sure if file extension is case sensitive (I am using Windows).
Grzegorz Gierlik
2010-10-26 11:22:53
The `:setf` is useless as it is already done by vim. The `:filetype on` is required though.
Luc Hermitte
2010-10-26 13:58:59