Mcvim youcomplete hint

  question, vim

图片描述

1.brew install vim
2. install vundle plug-in manager
3. install the youcomplete plug-in.

My vim has a prompt, but the prompt is all some characters in the current script. It does not prompt system library functions or other automatic input.
And pressing tab cannot complete it.

YCMForclangThe completion of depends onclang++ 3.70And above. In addition, completion is not necessarilytabYou have to see how vimrc is set up. mine isCtrl+j or kMake a choice



If everything is installed, open itvimAfter that, useVundleSee if the installation is successful, if it is successful, it may be a configuration problem.
The following is my ownYCMConfiguration in vimrc.bundle: see if it helps?

" YouCompleteMe {{{
 "youcompleteme defaults to tab s-tab and auto-completion conflicts
 "let g:ycm_key_list_select_completion=['<c-n>']
 let g:ycm_key_list_select_completion = ['<Down>']
 "let g:ycm_key_list_previous_completion=['<c-p>']
 let g:ycm_key_list_previous_completion = ['<Up>']
 LET G: YCM _ COMPLETE _ IN _ COMMENTS = 1 "can also be completed in the comment input
 Let g:ycm_complete_in_strings = 1 "can also be completed in string input
 Let g: ycm _ use _ UltiSnips _ completer = 1 "prompt ultisnips
 LET G: YCM _ COLLECT _ IDENTIFIERS _ FROM _ COMMENTS _ AND _ STRINGS = 1 "Comments and text in strings will also be filled in
 let g:ycm_collect_identifiers_from_tags_files = 1
 "Open grammar keyword completion
 let g:ycm_seed_identifiers_with_syntax=1
 
 "LET G: YCM _ SEED _ IDENTIFIERS _ WITH _ SYNTAX = 1" language keyword completion, but python keyword is very short, so you need to open it yourself
 
 "Jump to the definition, split screen opens
 let g:ycm_goto_buffer_command = 'horizontal-split'
 " nnoremap <leader>jd :YcmCompleter GoToDefinition<CR>
 nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
 nnoremap <leader>gd :YcmCompleter GoToDeclaration<CR>
 
 "The introduction can complete the system and python's third-party package is compatible with the new and old version YCM
 " old version
 if !  empty(glob("~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"))
 let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"
 endif
 " new version
 if !  empty(glob("~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"))
 let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
 endif
 
 "In direct trigger auto-completion insert mode
 " let g:ycm_key_invoke_completion = '<C-Space>'
 "blacklist, not enabled
 let g:ycm_filetype_blacklist = {
 \ 'tagbar' : 1,
 \ 'gitcommit' : 1,
 \}
 " }}}