2

私は Vim を neocomplcache プラグインと一緒に使用しています。完了時の使用プロンプトの機能は、私をとても混乱させました。

<C-X><C-U>次のように動作しました:カーソルが の最後にあるときに入力するos.path.と、行の下に補完候補がリストされるだけでなく、最初の候補の docstring を含む水平分割が上部に表示されました。私の質問は、この機能を削除して、使用プロンプトなしでコード補完のみを取得するにはどうすればよいですか?

ここに画像の説明を入力

4

1 に答える 1

10

It's all because preview is in completeopt by default, you can see its value by type command :set completeopt and the result should be completeopt=menu,preview.

What we need is just menu, so cut the preview, add this line in your vimrc:

set completeopt-=preview

vim help reference:

                        *'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".
于 2012-11-28T18:39:08.133 に答える