我正在使用带有neocomplcache插件的Vim,它的使用提示功能在完成时让我非常困惑。
表现如下:当光标位于<C-X><C-U>
的末尾时,我输入了os.path.
,然后不仅列出了完成候选项,还进行了水平拆分
其中包含第一个候选人的文档字符串
在顶部。我的问题是:如何摆脱这个功能,以便我只在没有使用提示的情况下获得代码完成?
答案 0 :(得分:10)
一切都是因为默认情况下preview
位于completeopt
,您可以按类型查看其值
命令:set completeopt
,结果应为completeopt=menu,preview
。
我们需要的只是menu
,所以切断preview
,在你的vimrc中添加这一行:
set completeopt-=preview
vim帮助参考:
*'completeopt'* *'cot'*
'completeopt' 'cot' string (default: "menu,preview")
global
{not available when compiled without the
|+insert_expand| feature}
{not in Vi}
A comma separated list of options for Insert mode completion
|ins-completion|. The supported values are:
menu Use a popup menu to show the possible completions. The
menu is only shown when there is more than one match and
sufficient colors are available. |ins-completion-menu|
menuone Use the popup menu also when there is only one match.
Useful when there is additional information about the
match, e.g., what file it comes from.
longest Only insert the longest common text of the matches. If
the menu is displayed you can use CTRL-L to add more
characters. Whether case is ignored depends on the kind
of completion. For buffer text the 'ignorecase' option is
used.
preview Show extra information about the currently selected
completion in the preview window. Only works in
combination with "menu" or "menuone".