Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to i show omnicomplete's autocomplete list without autocompleting current text

I am learning vim with omnicomplete. I am wondering whether I can show the omnicomplete list without autocompleting current text. For example,

If I type "str.c" and then invoke omnicomplete, it will show a list containing possible words starting with "c", and autocomplete the current text to, say "capitalize".

enter image description here

If, for example, the method I am looking for is count, I have to scroll all the way down the list to find it, or delete the "apitalize" part, and then type o, etc. Is it possible to just show the list, so that if I invoke it after c, it will show the list without autocompleting to capitalize? For example to something like below, where I can still type o to quickly go to count

enter image description here

like image 505
Louis Rhys Avatar asked Dec 01 '22 19:12

Louis Rhys


1 Answers

Thanks to @romainl comment, I looked up completeopt, and I found the answer Make Vim completion popup menu work just like in an IDE. It has a bunch of other related tips. To make the behaviour as described in the question,

:set completeopt=longest,menuone
like image 55
Louis Rhys Avatar answered Dec 18 '22 15:12

Louis Rhys