你需要这样:
引用
You have to add the following lines to your .vimrc to make sure vim uses file-specific indentions:
filetype on
filetype plugin on
filetype indent on
看这里:
http://stackoverflow.com/questions/10213744/vim-html-autoindent-not-working#10215433