1
如何让vim对* .h * .H * .C文件使用?我应该添加哪些行到vimrc?如何在vim中为* .h文件设置语法= cpp
如何让vim对* .h * .H * .C文件使用?我应该添加哪些行到vimrc?如何在vim中为* .h文件设置语法= cpp
试着这么做:
if has("autocmd")
" Enable file type detection
filetype on
autocmd BufNewFile,BufRead *.h,*.c setfiletype cpp
endif
我不知道,如果文件扩展名是大小写敏感的(我使用的是Windows)。
':setf'没用,因为它已经由vim完成了。 ':filetype on'是必需的。 – 2010-10-26 13:58:59