Centos下安装YouCompleteMe

背景

YouCompleteMe 是一个vim的插件组合包,包含了vSyntastic,jedi等众多插件。

安装

YouCompleteMe 依赖于 vim >7.3.584 ,clang >3.2

在centos6.4中clang版本较低,所以需要源码编译安装。
可以参考下面的文章

安装YouCompleteMe  需要vundle 插件的支持。

  • 首先需要安装vundle
      git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

      在/etc/vimrc中添加

      filetype off 
      set rtp+=~/.vim/bundle/vundle/
      call vundle#rc()
      Bundle 'Valloric/YouCompleteMe'
      filetype plugin indent on 

     上面的配置主要是将vundle进行了配置,以及配置了YouCompleteMe让vundle来进行管理
  • 从git库中下载YouCompleteMe的代码
      git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe

     需要对YouCompleteMe 进行编译,编译步骤如下

          cd ~
          mkdir ycm_build
          cd ycm_build
          cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/cpp
          cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/.vim/bundle/YouCompleteMe/cpp/llvm . ~/.vim/bundle/YouCompleteMe/cpp
          make ycm_core
          make ycm_support_libs

这样就安装完成了

  • 在/etc/vimrc中 配置一下YouCompleteMe使其生效 

let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'

现在就可以开始体验YouCompleteMe 


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值