lucasmenendez
lucasmenendez

Reputation: 116

Prevent autocomplete vim-go split screen

I made script to install my golang dev enviroment with vim, but my installation have annoying thing. (Here is my script)

When i use neocomplete and vim-go, autocompletion works fine but when i try to choose one of suggestions, the screen is splitted, and on top view print the same option that i am with cursor. Like this: enter image description here

Upvotes: 2

Views: 985

Answers (1)

Peter Rincker
Peter Rincker

Reputation: 45087

This is window is the preview window. This window can be set to show up during insert completion when 'completeopt' has preview set. You can disable this by adding the following to your vimrc file:

set completeopt-=preview

You can also close the preview window manually via <c-w>z/<c-w><c-z> or :pclose

If you want to keep the preview window but to not like that it stays open you can automatically close it via the CompleteDone autocmd event. Do so by adding the following to your vimrc file.

augroup completion_preview_close
  autocmd!
  autocmd CompleteDone * if !&previewwindow && &completeopt =~ 'preview' | silent! pclose | endif
augroup END

For more help see:

:h 'completeopt'
:h preview-window
:h :pclose
:h CompleteDone

Upvotes: 8

Related Questions