Reputation: 14423
How do I make vim use syntax=cpp
for *.h *.H *.C files? What line(s) should I add to vimrc?
Upvotes: 1
Views: 1956
Reputation: 11232
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).
Upvotes: 2