Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change the behavior of the vim omnicomplete menu?

Omnicompletion is working, but it automatically inserts the first result.

What I'd like to do is open the omnicomplete menu, then be able to type to narrow down the results, then hit enter or tab or space or something to insert the selected menu item.

Is this possible?

like image 562
andrew Avatar asked Nov 21 '08 23:11

andrew


1 Answers

The command you are looking for is:

:set completeopt+=longest

It will insert the longest common prefix of all the suggestions, then you can type and delete to narrow down or expand results.

like image 93
orestis Avatar answered Oct 20 '22 03:10

orestis