加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Make YouCompeleteMe work with vim

发布时间:2020-12-15 16:28:34 所属栏目:安全 来源:网络整理
导读:YouCompeleteMe is very powerful vim plugin for compeletion. Unfortunately,the default vim you installed probably don't support YouCompeleteMe. After adding config entries in .vimrc for YCM,you may get the warning below when open vim: youco

YouCompeleteMe is very powerful vim plugin for compeletion.

Unfortunately,the default vim you installed probably don't support YouCompeleteMe. After adding config entries in .vimrc for YCM,you may get the warning below when open vim:

youcompleteme unavailable: requires vim compiled with python (2.6+ or 3.3+) support

You need to build vim with python support. Follow this doc: Building Vim from source I'm using openSUSE,but this doc doesn't list zypper command to install prerequisites.

  • install packages
zypper install libncurses5 libgnome-devel libgnomeui-devel libgtk-2_0-0 libatk-1_0-0   libbonoboui-devel libcairo2 libX11-devel libXpm-devel libXt-devel python   
python-devel python3 python3-devel ruby-devel perl perl-devel lua51 lua51-devel git
  • clone vim
git clone https://github.com/vim/vim.git
  • config,build and install vim
cd vim 
./configure --with-features=huge 
            --enable-multibyte 
            --enable-rubyinterp 
            --enable-pythoninterp 
            --with-python-config-dir=/usr/lib/python2.7/config 
            --enable-perlinterp 
            --enable-luainterp 
            --enable-gui=gtk2 --enable-cscope --prefix=/usr

make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install

sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim
  • build YCM
cd .vim/bundle/YouCompleteMe
zypper install gcc-c++ cmake
./install.py

Open vim and edit something to test it. Enjoy!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读