install vim8.0 and YouCompleteMe in Centos 7

install dependency

yum install -y gcc-c++ ncurses-devel python-devel cmake python36u-devel

install vim

git clone https://github.com/vim/vim.git /root/mtl/vim

./configure \
  --disable-nls \
  --enable-cscope \
  --enable-gui=no \
  --enable-multibyte  \
  --enable-pythoninterp \
  --enable-rubyinterp \
  --prefix=/usr/local/vim \
  --with-features=huge  \
  --with-python-config-dir=/usr/lib/python3.6/config \
  --with-tlib=ncurses \
  --without-x

make && make install

configure vim

cp /etc/vimrc ~/.vimrc

mv /bin/vim /bin/vim_bak
ln /usr/local/vim/bin/vim vim

then install Vundle

install YouCompleteMe

git clone https://github.com/Valloric/YouCompleteMe.git  ~/.vim/bundle/YouCompleteMe

configure YouCompleteMe


cd ~/.vim/bundle/YouCompleteMe && git submodule update --init --recursive && python3 install.py --all

add YouCompleteMe to .vimrc

install jedi-vim

after install, then
add content below to ~/.vimrc
" ESTIMATE PYTHON VERSION, BASED ON THIS WE WILL SIMPLY CALL PY or PY3
" this will decide what version of pyton VIM will load
" note +python/dyn and +python3/dyn has to be loaded
let py_version = system('python -V 2>&1 | grep -Po "(?<=Python )[2|3]"')
if  py_version == 2
  python pass
elseif py_version == 3
  python3 pass
else
  python pass
endif

posted @ 2018-04-13 15:37  idlewith  阅读(353)  评论(0编辑  收藏  举报