本来打算在一台Linux虚拟机里安装个YouCompleteMe,结果出现了一行requirement惊呆了我
YouCompleteMe unavailable: requires Vim 7.4.143+
这不才只要7.3.xxx版本以上,突然偶要7.4以上了,偏偏源里安装的vim版本不够,只要手工编译一把
这里有需要一些python的依赖,具体可以vim –version看来下python和python3是否满足;然后首先将存在的vim全部卸载掉,包括vim-runtime等
这里安装的是vim8.0,整个编译过程如下:
debian,ubuntu系列
首先安装一些依赖
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \ libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \ python3-dev ruby-dev lua5.1 lua5.1-dev git
rhel,fedora系列
同样安装一些依赖
sudo yum install -y ruby ruby-devel lua lua-devel luajit \ luajit-devel ctags git python python-devel \ python3 python3-devel tcl-devel \ perl perl-devel perl-ExtUtils-ParseXS \ perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \ perl-ExtUtils-Embed
最后git clone进行编译即可,这里有一个选项要注意,–enable-pythoninterp和–enable-python3interp就是上面vim对python版本的支持,如果要安装ycm一定要带上
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 VIMRUNTIMEDIR=/usr/share/vim/vim80 sudo make install
最后即可发现
~# vim --version | grep python +cryptv +linebreak +python +vreplace +cscope +lispindent -python3 +wildignore Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/buildd/ruby1.9.1-1.9.3.484/debian/lib -rdynamic -Wl,-export-dynamic -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -ldl -L/usr/lib -llua5.1 -L/usr/lib/python2.7/config -lpython2.7 -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm -L/usr/lib