How do you automatically remove the preview window after autocompletion in Vim?

前端 未结 7 761
执笔经年
执笔经年 2021-01-29 18:05

I\'m using omnifunc=pythoncomplete. When autocompleting a word (e.g., os.), I get the list of eligible class members and functions, as

7条回答
  •  無奈伤痛
    2021-01-29 18:37

    You could throw in the following mappings to have certain keys try to close the preview window.

    inoremap  :wincmd z
    inoremap ( :wincmd z(
    inoremap ) :wincmd z)
    inoremap , :wincmd z,
    inoremap  :wincmd z
    inoremap  :wincmd z
    

    You could also use autocommands to close the preview window when you're finished in insert mode:

    augroup GoAwayPreviewWindow
    autocmd! InsertLeave * wincmd z
    augroup end
    

提交回复
热议问题