1. from software centerc++
1 $ apt-get install vim vim-youcompleteme vim-addon-managergit
2 $ vam install youcompletemegithub
3 修改 /usr/lib/vim-youcompleteme/ycm_extra_conf.pyvim
參考 https://github.com/Valloric/YouCompleteMe#completion-doesnt-work-with-the-c-standard-library-headerside
https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.pyspa
$ echo | clang -v -E -x c++ -rem
4 下面是我的在.vimrc中的配置get
"----------------youcompleteme config------------------------------
let g:ycm_autoclose_preview_window_after_insertion=1
"let g:ycm_seed_identifiers_with_syntax=1
"let g:ycm_cache_omnifunc=0
"nnoremap <C-]> :w<CR>:YcmCompleter GoToDefinitionElseDeclaration<CR>
nnoremap <C-]> :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_key_invoke_completion='<S-Space>'cmd
5 若你設置了 let g:ycm_autoclose_preview_window_after_insertion=1 it
那麼會有一個問題,軟件源中的vim-youcompleteme版本可能較低,是有bug的,得修改一個腳本
https://github.com/Valloric/YouCompleteMe/pull/1103/files
2. from https://github.com/Valloric/YouCompleteMe
1. vundle
2. after vundleinstall,
in bottom line: ycm....[so|a|..] and another lib is missing , you don't care it.
you had better do ( maybe vundle is some error) the following cmd in .vim/bundle/YouCompleteMe/
$ git submodule update --init --recursive
wait about one hour
3. llvm+clang
4 config, make etc.
你們在安裝過程當中有任何問題,能夠在下面回覆。