问题
YouCompleteMe (YCM) and jedi-vim are two vim plugins that provide autocompletion, and both use jedi underneath for Python. However it's nice to have both since jedi-vim provides some useful features in addition to documentation, like 'go to definition' and 'view docstring', while YouCompleteMe works with other languages.
Since both provide Python autocomplete, is any special configuration needed to prevent the two plugins from conflicting? Or will jedi-vim's autocompleter simply override YCM in Python?
回答1:
The most obvious conflict is not knowing whether you are using YCM or Jedi for autocompletion. In that case the simplest thing to do is to disable Jedi's autocompletion with a line in .vimrc
, and use YCM's awesome (Jedi-powered for Python) autocomplete everywhere.
let g:jedi#completions_enabled = 0
The key mappings are not too bad. Both plugins map <leader>d
(where <leader>
defaults to \
) but it doesn't matter, Jedi will override \d
in Python files only and that particular YCM feature is not supported in Python.
来源:https://stackoverflow.com/questions/29950767/does-jedi-vim-conflict-with-youcompleteme