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

转载于:https://www.cnblogs.com/otfsenter/p/8820728.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值