win下直接就有gvim8.1.exe安装。但linux下直接从apt-get里面下载的vim都是远古版本,需要手动编译安装。
首先,下载vim源代码
git clone https://github.com/vim/vim.git
如果下载不成功,可以试试通过gitee (2019年9月版本):
git clone https://gitee.com/chy-2003/vim.git
或者通过www.ipaddress.com获取ip,然后修改hosts
然后
cd vim
首先安装依赖
sudo apt-get install libncurses5-dev libncursesw5-dev
sudo apt-get install python-dev
#sudo apt-get install libncurses5-dev python-dev python3-dev libgtk-3-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
然后编译,安装
sudo ./configure --with-features=huge --with-x
sudo ./configure --with-features=huge --with-x --enable-multibyte --enable-rubyinterp --enable-pythoninterp --enable-python3interp --enable-luainterp --enable-cscope --enable-gui=gtk3 --enable-perlinterp --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ --with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/ --prefix=/usr/local/vim
sudo make
sudo make install
最后需要在~/.bashrc
中修改export PATH
,加入/usr/local/vim/bin
,source ~/.bashrc
一下就好了!
clipboard 需要x11环境
bashrc中改的那行大概变成
export PATH=/usr/bin:/bin:/usr/local/vim/bin:/sbin