简体   繁体   English

Vim : youCompleteme 插件打开一个带有函数定义的拆分窗口

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

I just downloaded and stated using the YCM plugin for vim.我刚刚下载并使用 vim 的 YCM 插件进行了说明。 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 ?关于如何配置 YCM 以不打开拆分窗口的任何建议? or at least shut the window when I select something.或者至少在我选择某些东西时关上窗户。

In your .vimrc file add this line :在你的 .vimrc 文件中添加这一行:

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.当此选项设置为 1 时,YCM 将在用户离开插入模式后自动关闭预览窗口。 This option is irrelevant if g:ycm_autoclose_preview_window_after_completion is set or if no preview window is triggered.如果设置了 g:ycm_autoclose_preview_window_after_completion 或未触发预览窗口,则此选项无关紧要。 See the g:ycm_add_preview_to_completeopt option for more details.有关更多详细信息,请参阅 g:ycm_add_preview_to_completeopt 选项。

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

Put this in your .vimrc :把它放在你的.vimrc

set completeopt-=preview

I think it fixes that according to https://github.com/ycm-core/YouCompleteMe/issues/2015我认为它根据https://github.com/ycm-core/YouCompleteMe/issues/2015解决了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM