Does jedi-vim conflict with YouCompleteMe?

此生再无相见时 提交于 2019-12-03 15:33:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!