1. 命令终端--cd /etc/vim--进入vimrc(vim vimrc) 2. 在此文件首行加入set cindent和set smartindent; 3 然后进入vim--在命令模式下 set cindent或者set smartindent; 设置OK;