1、编辑 vim /etc/vim/vimrc 2、修改 set ts=4 set expandtab set autoindent其实只要set ts=4 就ok了。 转载于:https://www.cnblogs.com/xingyunfashi/p/9187536.html