可以在~/.vimrc 文件中添加以下內(nèi)容:set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936這樣唆貌,就可以讓vim自動(dòng)識(shí)別文件編碼