diff --git a/README.md b/README.md index fc263cf..c7122f3 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,19 @@ inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" ``` +- Show and auto-close docstrings for Python completion (See [here](https://stackoverflow.com/q/3105307/2958070) for more information) + +```vim + " Add preview to see docstrings in the complete window. + let g:cm_completeopt = 'menu,menuone,noinsert,noselect,preview' + + " Close the preview window automatically on InsertLeave + " https://github.com/davidhalter/jedi-vim/blob/eba90e615d73020365d43495fca349e5a2d4f995/ftplugin/python/jedi.vim#L44 + augroup ncm_preview + autocmd! InsertLeave if pumvisible() == 0|pclose|endif + augroup END +``` + - If 'omnifunc' is the only available option, you may register it as a source for NCM.