Tech

安装Vim8.x

卸载系统自带的Vim

for Ubuntu

1
2
dpkg -l | grep vim
sudo apt-get remove vim vim-runtime vim-tiny vim-common

for CentOS

1
2
yum list installed | grep –i vim
sudo yum remove vim-enhanced vim-common vim-filesystem

安装相关包

for Ubuntu

1
sudo apt-get install libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libxpm-dev libxt-dev python-dev python3-dev ruby ruby-dev lua5.1 lua5.1-dev libperl-dev git catgs libncurses5-dev libncursesw5-dev

for CentOS

1
sudo yum install -y ctags git gcc make ncurses ncurses-devetcl-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

编译安装 Vim8.x

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
git clone https://github.com/vim/vim.git

cd vim
./configure --with-features=huge \
            --enable-multibyte \
            --enable-rubyinterp \
            --enable-pythoninterp \
            --with-python-config-dir=/usr/lib/python2.7/config \
            --enable-python3interp \
            --with-python3-config-dir=/usr/lib/python3.5/config \
            --enable-perlinterp \
            --enable-luainterp \
            --enable-gui=gtk2 \
            --enable-cscope \
            --prefix=/usr
make  && sudo make install

确认安装完成Vim8.x

1
vim --version | less

image

利用Ubuntu第三方源快速安装vim8.x

为什么都编译安装Vim8了还来个快速安装?

主要考虑要求不高,够用就好。

缺点: 不支持lua/ruby/perl,建议使用编译安装

1
2
3
sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim
1
2
sudo apt remove vim
sudo add-apt-repository --remove ppa:jonathonf/vim