2010-10-26 38 views

回答

1

试着这么做:

if has("autocmd") 
    " Enable file type detection 
    filetype on 
    autocmd BufNewFile,BufRead *.h,*.c setfiletype cpp 
endif 

我不知道,如果文件扩展名是大小写敏感的(我使用的是Windows)。

+0

':setf'没用,因为它已经由vim完成了。 ':filetype on'是必需的。 – 2010-10-26 13:58:59