ArchLinux the process of installing and configuring the Vim complement plug-in youcompleteme.
Reference:
Https://github.com/Valloric/YouCompleteMe
Https://github.com/gmarik/Vundle.vim
Http://www.cnblogs.com/zhongcq/p/3630047.html
1. Download Youcompleteme and syntastic with Vundle
2.pacman-s clang (compilation will get/usr/lib/libclang.so)
3. Using the Libclang library compiled from the previous step
cd ~mkdir ycm_buildcd ycm_build
cmake-g" Unix makefiles "-dexternal_libclang_path=/usr/lib/libclang.so . ~/.vim/bundle/youcompleteme/third_party/ycmd/cpp
Make Ycm_support_libs
4.配置.vimrc
"" "" "" "" "" Syntastic "" "" "" "" "" "Let G:syntastic_check_on_open = 1let g:syntastic_cpp_include_dirs = ['/usr/include/'] Let g:syntastic_cpp_remove_include_errors = 1let G:syntastic_cpp_check_header = 1let G:syntastic_cpp_compiler = ' clang+ + ' Let g:syntastic_cpp_compiler_options = '-std=c++11-stdlib=libstdc++ ' "set error or warning Signslet g:syntastic_error _symbol = '? ' Let G:syntastic_warning_symbol = '? ' " Whether to show balloonslet g:syntastic_enable_balloons = 1 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" Let G:ycm_global_ycm_ extra_conf = ' ~/.vim/bundle/youcompleteme/cpp/ycm/.ycm_extra_conf.py ' "Let G:ycm_collect_identifiers_from_tags_ Files = 1set Completeopt=longest,menu"Make Vim's full menu behavior consistent with the General IDE (ref. VIMTIP1228) autocmd Insertleave * if pumvisible () = = 0|pclose|endif"Auto close preview window after leaving insert mode Inoremap <expr> <space> pumvisible ()?" \<c-y> ":" \<space> ""Press SPACEBAR to select the current item let g:ycm_cache_omnifunc=0"Disable cache matches, regenerate matches every time let G:ycm_seed_identifiers_with_syntax = 1let g:ycm_confirm_extra_conf = 0" can also be complete in the comment input g:ycm_ complete_in_comments = 1 "in string input can also complement let G:ycm_complete_in_strings = 1" comments and text in the string will also be revenue complement let G:ycm_collect_identifiers _from_comments_and_strings = 0nnoremap <leader>jd:ycmcompleter gotodefinitionelsedeclaration<cr> " Jump to Definition "," "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""