Install YCM on CentOS
1. Install vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
2. Configure. 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. Open vim to run
:BundleInstall
4. install necessary tools
1. yum install gcc-c ++ make automake python-devel2, install CMakewget http://www.cmake.org/cmake/resources/software.htmltar-zxv-f cmake -*. *. *. * .tar.gz cd cmake -*. *. *. * .tar.gz. /bootstrapgmakegmake install
5. Install clang + llvm (compiled here)
1. wget http://llvm.org/releases/3.5.1/clang+llvm-3.5.1-x86_64-fedora20.tar.xzxz-d clangw.llvm-3.5.1-x86_64-fedoraw.tar. xztar xvf clang+llvm-3.5.1-x86_64-fedora20.tar cd clang + llvm-3.5.1-x86_64-fedora20 Note: tar xvf clangw.llvm-3.5.1-x86_64-fedoraw.tar is also available. xz decompress 2. Add the following two lines of code at the end of the/etc/profile file: PATH =/usr/local/cmake/bin:/usr/clang_3_3/bin: $ PATHexport PATH3: Execute the update variable: source/etc/profile
6. Go to the YCM directory and run
./install.sh –clang-completer
7 ~ /. Configure 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' : ['.', ':']\ }