1

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
    Commented Feb 12, 2021 at 9:49

2 Answers 2

1

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.

2
  • 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
    Commented Feb 13, 2021 at 7:34
  • For all "list of possibilities" maybe use :g/ instead of /?
    – gildux
    Commented Feb 1, 2023 at 23:55
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 and acknowledge you have read our privacy policy.

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