Next vim result

I have incsearch and hlsearch

So, I pressed / to enter search mode.

Then I type in the text that I want to find, and it finds the first occurrence of the text that I typed.

Then I want to move on to the next input of text that I typed, but did not exit the search mode, to subsequently process the search text without having to return to normal mode, then press n , and then return to search mode, press / again.

If possible, how can I do this?

+8
vim
source share
3 answers

The best I can find what you can do is this:

Pattern Search Using / blah

Then press n or? until you see what's there ...

Then go back to / and press CTRL-r /

this will return the last template you were looking for, so you can continue to enter more text there ...

I am sure that you can reassign this combination to some key so that you can quickly return to the search with the template already entered.

+6
source share

I found a way thanks to bwana147 from the #vim irc channel on freenode.net

 :cnoremap <cn> <CR>n/<cp> 

After that, entering text in search mode , and then pressing ctrl-n proceeds to the next input of this text without exiting search mode

+6
source share

I have incsearch and hlsearch . So I pressed / to enter search mode. Then I type the text that I want to find, and it detects the first occurrence.

Okey so far ...

Here I can’t understand what you are asking.

Then I want to move on to the next text entry that I typed without leaving search mode

This is done by pressing n

so that I can refine the search text later, without leaving normal mode, and then pressing n , and then return to the search mode by pressing / again.

You lost me here ... Isn't that what incsearch allows you to do?

+5
source share

All Articles