编辑配置文件

vim /etc/vim/vimrc

增加下面3个参数,保存退出即可

set ts=4
set expandtab
set autoindent