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

Louis Rhys picture Louis Rhys · Apr 14, 2013 · Viewed 9.1k times · Source

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

Answer

Louis Rhys picture Louis Rhys · Apr 14, 2013

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