vim ~/.vimrc

如果没有就自行创建

set ts=4       #设置tab为4个空格

set expandtab  #扩展tab键为空格

set autoindent #自动缩进