rhel7.0中将vim 7.4 升级到 vim 8.2版本

 

001、查看系统

[root@PC1 test]# hostnamectl
   Static hostname: PC1
         Icon name: computer
           Chassis: n/a
        Machine ID: 1739a8a8e564458e93c6b2f64619a348
           Boot ID: b1cc2b22a0554c648a07c592a0b75ace
    Virtualization: vmware
  Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server
            Kernel: Linux 3.10.0-123.el7.x86_64
      Architecture: x86_64

 

 

002、查看当前vim版本

[root@PC1 test]# vim --version | head
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 30 2014 10:56:39)
Included patches: 1-160
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl

 

 

003、下载vim8.2版本安装包

下载地址:https://ftp.nluug.nl/pub/vim/unix/

 

 

下载命令:

wget --no-check-certificate https://ftp.nluug.nl/pub/vim/unix/vim-8.2.tar.bz2

 

 

004、安装依赖环境(一路点y)

[root@PC1 software]# yum install perl-devel python3-devel tcl-devel lua-devel ncurses-devel lua expectk expect-devel

 

 

004、解压安装

[root@PC1 software]# tar -xjvf vim-8.2.tar.bz2         ## 解压
[root@PC1 src]# cd vim82/src/                          ## 进入编译目录
[root@PC1 src]#  ./configure --prefix=/opt/vim82 --enable-luainterp=yes  --enable-pythoninterp=yes --with-python3-command=python3   --with-python3-config-dir=/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu --enable-python3interp=yes --enable-tclinterp=yes --enable-rubyinterp=yes --enable-cscope --enable-terminal --enable-multibyte --with-tclsh=tclsh --with-ruby-command=ruby
[root@PC1 src]# make install                           ## 安装

 

 

005、测试当前路径下安装的版本

[root@PC1 src]# ./vim --version | head

 

 

006、检测系统环境中的调用路径

[root@PC1 src]# which vim
/usr/bin/vim

 

 

007、备份系统默认的vim命令

[root@PC1 src]# mv /usr/bin/vim /usr/bin/vim.bak   ## 将系统默认的vim命令备份为vim.bak

 

008、将安装好的vim8.2版本在系统默认的调用路径中添加软链接

[root@PC1 src]# ln -s /opt/vim82/bin/vim /usr/bin/vim  ## /opt/vim82/bim/vim 也是最新安装的vim8.2

 

009、测试系统当前调用的vim版本

[root@PC1 src]# vim --version | head  ## 系统默认调用为8.2版本

 

参考:http://www.manongjc.com/detail/24-phpocwcirugtjsw.html 

 

posted @ 2022-09-07 16:56  小鲨鱼2018  阅读(462)  评论(0编辑  收藏  举报