Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim : youCompleteme plugin opens up a split window with function definition

I just downloaded and stated using the YCM plugin for vim. However I noticed that whenever the auto-complete pops up giving completion suggestions a split window also opens up in my current window. Any suggestions on how I can configure YCM to not open up a split window ? or at least shut the window when I select something.

like image 248
James Franco Avatar asked Jul 22 '16 19:07

James Franco


2 Answers

In your .vimrc file add this line :

let g:ycm_autoclose_preview_window_after_insertion = 1

According to the documentation :

When this option is set to 1, YCM will auto-close the preview window after the user leaves insert mode. This option is irrelevant if g:ycm_autoclose_preview_window_after_completion is set or if no preview window is triggered. See the g:ycm_add_preview_to_completeopt option for more details.

For more infos : https://github.com/Valloric/YouCompleteMe#the-gycm_autoclose_preview_window_after_completion-option

like image 102
Oussama Salimi Avatar answered Sep 28 '22 18:09

Oussama Salimi


Put this in your .vimrc:

set completeopt-=preview

I think it fixes that according to https://github.com/ycm-core/YouCompleteMe/issues/2015

like image 33
Alireza Sadeghi Avatar answered Sep 28 '22 17:09

Alireza Sadeghi