找到vim的配置文件: vi /etc/vim/vimrc 在vimrc文件尾部添加: set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab 参考: https://www.jianshu.com/p/162c19cc9c11