系统最小安装默认没有安装vim,

[1]Install vim

yum -y install vim

[2]configure vim

vim /etc/profile

#最后一行添加

alias vi='vim'

source /etc/profile

[3]configure format vim

vim ~/.vimrcset nocompatibleset tabstop=4set softtabstop=4set shiftwidth=4set numberset listset showmatchset wrap

source ~/.vimrc

问题解决1:

【“Swap file ".文件名.swp" already exists![O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit:】)

处理方法: 打开 /etc/vimrc 并添加 set noswapfile