vim8.1的安装

vim8.1的安装

八月 25, 2020

vim安装包网址:https://github.com/vim/vim/releases

一、卸载旧版本

1
2
3
4
5
6
7
~$ rpm -qa | grep vim
vim-common-7.4.160-2.el7.x86_64
vim-enhanced-7.4.160-2.el7.x86_64
vim-minimal-7.4.160-2.el7.x86_64
vim-filesystem-7.4.160-2.el7.x86_64

~$ sudo rpm -e vim-common-7.4.160-2.el7.x86_64 vim-enhanced-7.4.160-2.el7.x86_64 vim-minimal-7.4.160-2.el7.x86_64 vim-filesystem-7.4.160-2.el7.x86_64 --nodeps

二、获取源码

1
~$ wget <ftp://ftp.vim.org/pub/vim/unix/vim-8.1.tar.bz2>

三、编译安装

1
2
3
4
5
~$ tar -xjf vim-8.1.tar.bz2
~$ cd vim81
~$ ./configure --enable-multibyte --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-python3interp=yes
make
~$ sudo make install

检验版本

使用vim —version

或者直接在终端输入vim进行查看

注意事项

为了使vim支持ruby、lua、perl、python2、python3编写的插件,在正式编译安装vim之前需要在系统中安装好相关插件,否则编译vim会出错。

1
2
3
4
5
6
sudo yum install ruby ruby-devel lua lua-devel luajit \\
luajit-devel ctags git python python-devel \\
python36 python36-devel tcl-devel \\
perl perl-devel perl-Extutils-ParseXS \\
perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \\
perl-ExtUtils-Embed libX* ncurses-devel gtk2-dev