Ubuntu14.04 YouCompleteMe Configure

安装准备

1.1 安装vim

[cpp]  view plain copy
  1. sudo apt-get install vim  

1.2 安装cmake

[cpp]  view plain copy
  1. sudo apt-get install cmake  

1.3 安装python

[cpp]  view plain copy
  1. sudo apt-get install python-dev  

1.4 安装LLVM

    参考资料[1]指出,YouCompleteMe精确的补全功能完全依赖于Clang的代码解析,因此下载Clang for Ubuntu 14.04(选择Download LLVM 3.6.2,Pre-built Binaries,下载的默认文件名为clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz)。

    由于下载的是预编译版,所以只需要将clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz解压到Ubuntu14.04(64bit)的目录中即可,本文选择Downloads目录。

[cpp]  view plain copy
  1. liyihai@ubuntu:~/Downloads$ tar -axvf clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz  

1.5 安装Vundle

    这里采用一种与参考资料[2]不同的安装方法。先下载Vundle.vim-master.zip,解压到~/.vim/bundle/目录中(先创建~/.vim目录及其子目录bundle)。然后创建文件~/.vimrc,在其中指定Vundle目录:

[cpp]  view plain copy
  1. set rtp+=~/.vim/bundle/Vundle.vim-master  

    此时,Vundle算是安装成功,可以用它来管理vim插件了。

1.6 安装git

    由于Vundle是通过git来下载插件的,因此需要安装这个工具。

[cpp]  view plain copy
  1. sudo apt-get install git  

2 安装YouCompleteMe

2.1 下载    

通过Vundle下载YouCompletelMe插件

    (1)在~/.vimrc中添加:

[cpp]  view plain copy
  1. Bundle 'Valloric/YouCompleteMe'  
    说明:更加详细的设置,见《 Ubuntu14.04(32bit)配置YouCompleteMe 》。

    (2)根据参考资料[2]的说明,使用BundleInstall命令安装YouCompleteMe。

2.2 编译

    (1)在~目录中创建目录ycm_buid,然后进入ycm_build目录

[cpp]  view plain copy
  1. cd ycm_build  

    (2)通过cmake产生Makefile:

[cpp]  view plain copy
  1. cmake -G "Unix Makefiles"  ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp -DEXTERNAL_LIBCLANG_PATH=~/Downloads/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/lib/libclang.so  

    (3)编译+安装

[cpp]  view plain copy
  1. liyihai@ubuntu:~/Downloads/ycm_build$ make ycm_support_libs  

    至此,YouCompleteMe已经算是安装成功(执行上面的命令,就算是编译+安装了)!

    注意:这时候,ycm_build目录可以删除啦!

2.3 配置

    见《Ubuntu14.04(32bit)配置YouCompleteMe》。

3 清理垃圾

    安装成功后,ycm_build以及clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04目录都可以删除,不影响YouCompleteMe插件的使用。

参考资料

[1]Ubuntu13.04配置:Vim+Syntastic+Vundle+YouCompleteMe

[2]vim之vundle

FROM:http://blog.csdn.net/q1302182594/article/details/46953069

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值