0

Autocomplete in insert mode (via <c-n>/<c-p>) is excellent, in particular the navigable popup box.

I would like the same navigable popup box when I search: so, I type /, then start to type, press something, see a list of selectable matches, select one and jump to that location.

Is this possible without a plugin?

1
  • 2
    Hi and welcome! This is not the intended usage of the completion list and would probably quite tricky to implement. However, fzf provides a :Lines command which makes it easy to jump to lines matching your search (fuzzy). That's the closer I can think of.
    – Biggybi
    Feb 12 at 9:49
0

Usually you're supposed to do "incremental search" instead. It works like follows: you do :set incsearch and then Vim starts moving the cursor while you're typing /pattern without awaiting for "enter" hit.

If you really need to browse through previous search patterns, you can make use of :h cmdwin. Just press Ctrl-F (or whatever is the value of :set cedit?), or even open search prompt with q/ instead of /. The you'll get into :h cmdwin where you can browse all your previous search patterns. Note that it's a "window" not "menu", so you can search through searches with "/" or "?" as needed.

1
  • Thanks. The cmdwin may be useful. incsearch isn't great for my case, because i want to quickly see a list of possibilities--like an overview--then choose, rather than search those all the searches until I find the one I want.
    – mmm111mmm
    Feb 13 at 7:34
0

This doesn't answer my question, but I thought it may enlighten others.

The reasons I wanted this fast-search-with-autocomplete-box was to quickly and repeatedly switch between and edit parts of a file.

I subsequently learnt to use window splits. I now quickly and repeatedly edit different parts of a file using window splits; edit one part, ctrl w w, edit the other, repeat.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.