Ubuntu12.04安装YouCompleteMe插件
以前用的都是ctags+omnicomplete+acp的方式,这次换成clang自解析的方式尝试一把。
自从知道了Vundle,妈妈再也不用担心我麻烦地下插件了
0. 安装必要组件
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.-dev libatk1.-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev \
python-dev ruby-dev mercurial checkinstall
1. 升级Vim 到7.4
1) 自己编译
I) 卸载原有的Vim
sudo apt-get remove vim vim-tiny vim-common vim-runtime gvim vim-gui-common
下载最新的Vim源码
hg clone https://vim.googlecode.com/hg/ vim cd vim
./configure --with-features=huge \
--enable-rubyinterp=yes \
--enable-pythoninterp=yes \
--enable-python3interp=yes \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 --enable-cscope --prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim74
make install
2) 手动添加PPA(Personal Package Archives)
sudo add-apt-repository ppa:nmi/vim-snapshots
sudo apt-get update
sudo apt-get install vim
2. 安装llvm & clang
到 http://llvm.org/releases/download.html#3.3 下载编译后的二进制文件
wget http://llvm.org/releases/3.3/clang+llvm-3.3-amd64-Ubuntu-12.04.2.tar.gz
解压到/
tar -zxf clang+llvm-3.3-amd64-Ubuntu-12.04..tar.gz
cd clang+llvm-3.3-amd64-Ubuntu-12.04./
cp -r * /
如果在命令行输入clang,输出clang: error: no input files,说明安装成功
3. 下载 Vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
Vundle可以让Vim自动从github等地方下载插件,而不用每次去vim.org上手动下载
修改.vimrc
set nocompatible " be iMproved
set nu
set noswapfile
syntax on
set backspace=
set tabstop=
set shiftwidth=
set completeopt=menu
:colorscheme ron
set cindent
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Valloric/YouCompleteMe'
Bundle 'scrooloose/syntastic'
""""""""""syntastic""""""""""""
let g:syntastic_check_on_open =
let g:syntastic_cpp_include_dirs = ['/usr/include/']
let g:syntastic_cpp_remove_include_errors =
let g:syntastic_cpp_check_header =
let g:syntastic_cpp_compiler = 'clang++'
"set error or warning signs
let g:syntastic_error_symbol = 'x'
let g:syntastic_warning_symbol = '!'
"whether to show balloons
let g:syntastic_enable_balloons = """"""""""""YCM""""""""""""""""""""
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_collect_identifiers_from_tags_files =
let g:ycm_seed_identifiers_with_syntax =
let g:ycm_confirm_extra_conf =
然后打开vim
在命令模式下输入
:BundleInstall,就会发现vim自动开始下载插件了
NOTE:
YouCompleteMe插件要下载很久,请稍安勿躁:-)
4. 编译ycm_core & ycm_support_libs
cd ~
mkdir ~/ycm_build
cd ~/ycm_build
cmake -G "Unix Makefiles" ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ -DEXTERNAL_LIBCLANG_PATH=/lib/libclang.so
make ycm_core
make ycm_support_libs
这里要注意的是-DEXTERNAL_LIBCLANG_PATH这个参数,用于指定libclang.so的位置
5. 配置.ycm_extra_conf.py
~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py
在这个文件的flags尾部添加:
'-isystem',
'/usr/include',
'-isystem',
'/usr/include/c++/'
最后
该文章转自http://blog.csdn.net/unhappypeople/article/details/19160243,同时改正其中的有些细小错误。
Ubuntu12.04安装YouCompleteMe插件的更多相关文章
- 【转】Ubuntu12.04安装YouCompleteMe插件
原文网址:http://m.blog.csdn.net/blog/unhappypeople/19160243 以前用的都是ctags+omnicomplete+acp的方式,这次换成clang自解析 ...
- Ubuntu下如何安装YouCompleteMe插件
Ubuntu安装YouCompleteMe插件 简介: 众所周知, Vim是一款linux下的文本编辑器, 其最基础的工作就是编辑文本,而不管该文本的内容是什么. 在Vim被程序员所使用后,其慢慢的被 ...
- Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dir
问题: Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared obje ...
- ubuntu12.04安装svn 1.7(转载)
ubuntu12.04安装svn 1.7 分类: ubuntu2013-10-22 16:03 239人阅读 评论(0) 收藏 举报 svnubuntu 目录(?)[+] 1.问题 在 ...
- ubuntu12.04 安装 php5.4/php5.5
1:修改源(我使用163的源)直接修改/etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ precise main universe re ...
- Ubuntu12.04 安装Samba
Ubuntu12.04 安装Samba Ubuntu12.04 安装Samba 本教程介绍了在Ubuntu12.04安装Samba文件服务器,以及如何配置它通过SMB协议共享文件,以及如何将用户添加. ...
- Ubuntu12.04安装java6
按照android官方文档 http://source.android.com 下载编译android源代码,jdk安装失败,尝试一下方法成功(2013-11-20) 下面我就把在Ubuntu12.0 ...
- [分享]Ubuntu12.04安装基础教程(图文)
[分享]Ubuntu12.04安装基础教程(图文) 原文地址: http://teliute.org/linux/Ubsetup/lesson21/lesson21.html 1.进入 live cd ...
- windows7 Cygwin 下安装 YouCompleteMe 插件
原创文章,欢迎指正!转载请注明~ 从上周就开始想在cygwin上安装YouCompleteMe插件,按照GITHUB上的官方教程安装,由于自己的理解失误,一直搞不清是按照在windows上安装还是按照 ...
随机推荐
- [原] blade中C++ singleton的实现
最近看了龚大大KalyGE中的singleton, 觉得非常不错(C++中线程安全并且高效的singleton). 可惜blade的代码都是C++03的, 没有使用C++11的任何特性. 笔者对于si ...
- 使用css3伪元素制作时间轴并且实现鼠标选中高亮效果
利用css3来制作时间轴的知识要点:伪元素,以及如何在伪元素上添加锚伪类 1)::before 在元素之前添加内容. 2)::after 在元素之后添加内容. 提示:亦可写成 :before :aft ...
- ASP.NET页面优化性能提升方法记录
今天与大家分享:一种优化页面执行速度的方法.采用这个方法,可以使用页面的执行速度获得[8倍]的提升效果. 为了让您对优化的效果有个直观的了解,我准备了下面的测试结果截图: 测试环境:1. Window ...
- 【译】 沙箱中的间谍 - 可行的 JavaScript 高速缓存区攻击
王龑 - MAY 27, 2015 原文连接 The Spy in the Sandbox – Practical Cache Attacks in Javascript 相关论文可在 https:/ ...
- jQuery学习记录1
jquery 和 js css里面都是坑呀 this.style.backgroundColor 和 css {background:#8df;} 是冲突的,用了前者,再$(this).addClas ...
- 全国DNS汇总
全国DNS汇总 来路不明的DNS服务器可能导致你的帐号密码轻易被盗,请谨慎使用!在中国大陆,最科学的方法是将首选DNS服务器设置为114.114.114.114,备用DNS服务器设置为当地电信运营商的 ...
- ExtJs布局之BOX
<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...
- 堆排序 Heap Sort
堆排序虽然叫heap sort,但是和内存上的那个heap并没有实际关系.算法上,堆排序一般使用数组的形式来实现,即binary heap. 我们可以将堆排序所使用的堆int[] heap视为一个完全 ...
- QTP菜单消失的解决办法
解决办法一:点击QTP上方菜单栏“Tools” menu->options 项,点击"General" tab, 最后点击“Restore Layout”按钮. 解决办法二: ...
- Spring中RedirectAttributes对象重定向传参
Spring3中的FlashAttribute 为 了防止用户刷新重复提交,save操作之后一般会redirect到另一个页面,同时带点操作成功的提示信息.因为是Redirect,Request里 的 ...