vim中默认的tab建为8个空格,看着爽,修改为4个空格首先显得安装vim 打开vim /etc/vimrc在文件最后添加如下内容:set ts=4set expandtabset autoindent保存退出就可以了