查看当前版本
[root@VM-0-4-centos ~]# vim --V
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 9 2019 03:17:15)
删除老版本
[root@VM-0-4-centos ~]# yum -y remove vim
github下载新版本
[root@VM-0-4-centos ~]# cd /ROOT/source/
[root@VM-0-4-centos source]# wget https://github.com/vim/vim/archive/refs/tags/vim-8.2.4501.tar.gz
[root@VM-0-4-centos source]# tar -zxvf vim-8.2.4501.tar.gz
配置
[root@VM-0-4-centos vim-8.2.4501]# ./configure --prefix=/usr/local/vim8/
报错,缺少ncurses库
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
On Linux that would be the libncurses-dev package.
Or specify the name of the library with --with-tlib.
直接yum安卓一个
[root@VM-0-4-centos vim-8.2.4501]# yum install libncurses-dev
重新配置/编译/安装
[root@VM-0-4-centos vim-8.2.4501]# ./configure --prefix=/usr/local/vim8/
[root@VM-0-4-centos vim-8.2.4501]# make
[root@VM-0-4-centos vim-8.2.4501]# make install
查看新版本,安装成功
[root@VM-0-4-centos vim-8.2.4501]# vim --Version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 4 2022 11:50:30)
Included patches: 1-4501
Compiled by hcm@VM-0-4-centos