这是来自我当前的 ~/.vim/vimrc:
" Eclim + YouCompleteMe {{{1
" See <~/MyDocs/SysAdmin/Eclim.otl>
" This next line recommended by Eclim installation instructions
autocmd FileType php,java,ruby let g:EclimCompletionMethod = 'omnifunc'
" For your list of filetypes where you want Eclim semantic completion
" as the default YCM completion mode:
autocmd FileType php,java,ruby,c,cpp,perl,python
\if &completefunc != '' | let &omnifunc=&completefunc | endif
" This will allow you to hit <Enter> in normal mode to search for the
" word under the cursor
nnoremap <silent> <buffer> <cr> :PhpSearchContext<cr>
" End Eclim + YouCompleteMe }}}1
我发现当我想使用 Eclim 的语义完成时,我需要有 &omnifunc = &completefunc。
我不确定我是否完全理解,但看起来 Eclim 期望omnifunc 而YCM 期望completefunc,其中用户完成= completefunc 和Omni 完成=omnifunc