1、安裝vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2、配置.vimrc
set nocompatible filetype offset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()Plugin 'VundleVim/Vundle.vim'Plugin 'tpope/vim-fugitive'call vundle#end() Bundle 'Valloric/YouCompleteMe'filetype plugin indent on
3、打開vim運行
:BundleInstall
4、安裝必要工具
1、yum install gcc gcc-c++ make automake python-devel2、安裝CMakewget http://www.cmake.org/cmake/resources/software.htmltar -zxv -f cmake-*.*.*.*.tar.gzcd cmake-*.*.*.*.tar.gz./bootstrapgmakegmake install
5、安裝clang+llvm(這裡用已經編譯好的)
1、wget http://llvm.org/releases/3.5.1/clang+llvm-3.5.1-x86_64-fedora20.tar.xzxz -d clang+llvm-3.5.1-x86_64-fedora20.tar.xztar xvf clang+llvm-3.5.1-x86_64-fedora20.tarcd clang+llvm-3.5.1-x86_64-fedora20注:也可用tar xvf clang+llvm-3.5.1-x86_64-fedora20.tar.xz解壓2、在/etc/profile這個檔案最尾端添加以下兩行代碼:PATH=/usr/local/cmake/bin:/usr/clang_3_3/bin:$PATHexport PATH3、執行更新變量:source /etc/profile
6、進入YCM目錄,運行
./install.sh –clang-completer
7、對~/.vimrc做配置
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/y cmd/cpp/ycm/.ycm_extra_conf.py'let g:ycm_confirm_extra_conf = 0let g:ycm_semantic_triggers = { \ 'c' : ['->', ' ', '.', ' ', '(', '[', '&'],\ 'cpp,objcpp' : ['->', '.', ' ', '(', '[', '&', '::'],\ 'perl' : ['->', '::', ' '],\ 'php' : ['->', '::', '.'],\ 'cs,java,javascript,d,vim,python,perl6,scala,vb,elixir,go' : ['.'],\ 'ruby' : ['.', '::'],\ 'lua' : ['.', ':']\ }
http://www.bkjia.com/Linuxjc/1195994.htmlwww.bkjia.comtrue