编辑~/.vimrc,添加以下内容 set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab set nu set autoindent set cindent source ~/.vimrc