在控制台中输入vi ~/.vimrc 打开文档在里面设置: set nu; //显示行号 set autoindent //自动缩排 set tabstop=4 //TAB键为4个字符 当然还有很多设置,以后慢慢增加