以前用的都是ctags+omnicomplete+acp的方式,这次换成clang自解析的方式尝试一把
自从知道了Vundle,妈妈再也不用担心我麻烦地下插件了
0. 安装必要组件
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \ libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ libcairo2-dev libx11-dev libxpm-dev libxt-dev \ python-dev ruby-dev mercurial checkinstall
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
tar -zxf clang3.3-amd64-Ubuntu-12.04.2.tar.gz cd clang+llvm-3.3-amd64-Ubuntu-12.04.2/ cp -r * /
set nocompatible " be iMproved set nu set noswapfile syntax on set backspace=2 set tabstop=2 set shiftwidth=2 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 = 1 let g:syntastic_cpp_include_dirs = ['/usr/include/'] let g:syntastic_cpp_remove_include_errors = 1 let g:syntastic_cpp_check_header = 1 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 = 1 """"""""""""YCM"""""""""""""""""""" let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' let g:ycm_collect_identifiers_from_tags_files = 1 let g:ycm_seed_identifiers_with_syntax = 1 let g:ycm_confirm_extra_conf = 0
cd ~ mkdir ~/ycm_build cd ~/ycm_build cmake -G "Unix Makefiles" ~/.vim/bundle/YouCompleteMe/cpp -DEXTERNAL_LIBCLANG_PATH=/lib/libclang.so make ycm_core make ycm_support_libs