站点图标 兰玉磊的个人博客

Centos VIM7.4 升级到 VIM8

概述

最近出了一次差,在途中自然有很多需要等待的时候,然后我肯定是拿出电脑出来敲一敲代码了,但是,出去之后发现一个不爽的点就是用 IDE(Goland)需要用鼠标,很不方便。所以,为了解决一下问题,我觉得还是将 VIM 重新捡起来,所以就尝试在 CentOS 7 中升级一下自己的 Vim 到 Vim 8。

删除旧的 Vim

要安装新的,首先还是得把旧的删除掉,不然后面可能会乱:

[root@lanyulei]# yum list installed | grep –i vim
vim-common.x86_64                     2:7.4.1868-1.el7.centos          @anaconda
vim-enhanced.x86_64                   2:7.4.1868-1.el7.centos          @anaconda
vim-filesystem.x86_64                 2:7.4.1868-1.el7.centos          @anaconda
vim-minimal.x86_64                    2:7.4.1868-1.el7.centos          @anaconda
[root@lanyulei]# yum remove vim-enhanced vim-common vim-filesystem vim-minimal

安装依赖

[root@lanyulei]# yum install -y gcc make ncurses ncurses-devel
[root@lanyulei]# yum install ctags git tcl-devel \
    ruby ruby-devel \
    lua lua-devel \
    luajit luajit-devel \
    python python-devel \
    perl perl-devel \
    perl-ExtUtils-ParseXS \
    perl-ExtUtils-XSpp \
    perl-ExtUtils-CBuilder \
    perl-ExtUtils-Embed

构建 Vim 8

[root@lanyulei]# git clone https://github.com/vim/vim.git
[root@lanyulei]# cd vim
[root@lanyulei]# ./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp \
--enable-pythoninterp \
--enable-perlinterp \
--enable-luainterp \
--enable-gui=no
[root@lanyulei]# make
[root@lanyulei]# make install

确认安装

[root@lanyulei]# vim --version | head -1
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun  2 2020 18:50:01)

其他选择

如果你嫌弃麻烦,那么可以直接通过 RPM 安装:

[root@lanyulei]# rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
[root@lanyulei]# rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
[root@lanyulei]# yum -y remove vim-minimal vim-common vim-enhanced
[root@lanyulei]# yum -y --enablerepo=gf-plus install vim-enhanced

Ref

退出移动版