The omni-completion feature in gVim (under Windows, with mostly default settings) brings up a second buffer, called [Scratch] [Preview].
When I finish selecting an item from the omni-completion popup menu, this buffer doesn't go away. Currently, I am closing it via:
- ESC(to get to normal mode)
- CTRLwk:q
I have seen questions on customizing the buffer height, or keeping it from popping up entirely, but I like the size, and I like having it there while I'm selecting. Is there an easier way to get it to go away after I've selected what I want?
A simpler shortcut under Windows "default" bindings would be best, though careful remaps that aren't likely to interfere with anything would be okay too.
Answer
Add this to your vimrc to auto close the preview window when you exit the insert mode:
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
Comments
Post a Comment