author : headsen chen
date: 2018-05-11 09:50:23
[root@localhost ~]# which vim
/usr/bin/vim
[root@localhost ~]# rpm -qf /usr/bin/vim
vim-enhanced-7.4.160-1.el7.x86_64
[root@localhost ~]#rm -f /usr/bin/vim # -------------------> 删除vim命令,模拟命令错误
ls -l /usr/bin/vim
#开始重新下载安装vim命令:
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
tar fx vim-7.4.tar.bz2
cd vim74/
yum -y install ncurses-devel ncurses # -----------------> 要先安装这个库,否则下面的编译会报错!!!!!!!!!!!!!!
./configure --prefix=/usr/local/vim74
make
make install
vim
/usr/local/vim74/bin/vim /etc/profile # ------------------> 末行添加: PATH=$PATH:/usr/local/vim74/bin/vim;export
# 用别名也可以:
# alias vim='/usr/local/vim74/bin/vim'
source /etc/profile
echo $PATH
vim
vim /etc/profile