Search code examples
vimnerdcommenter

Toggling preview tab for pydoc


I am new to VIM and I had this happened on few occasions. I am using these plug-ins:

  • nerdcommenter-master
  • vim-autoclose-master
  • vim-multiple-cursors-master
  • nerdtree-master
  • vim-autocomplpop

Sometimes I am typing python commands and autocomplete comes up, and I accidentally hit something. This new tab pop-ups with help text, describing the autocompleted command, basically like using pydoc. I'd like to know what this is called and how can I invoke it (I find it very useful).


Solution

  • What you see is the omni completion from the Python filetype plugin that ships with Vim, in $VIMRUNTIME/autoload/pythoncomplete.vim. It is automatically triggered by the AutoComplPop plugin. You can also explicitly invoke it by pressing <C-x><C-o> in insert mode; :help i_CTRL-X_CTRL-O.

    The preview comes courtesy of :set completeopt+=preview.