2

If I do a replace like this:

:%s/May/June/gc

afterward I keep hitting y or n as needed. But sometimes it hit n on accident and need to go back. I read that you can use N for this purpose, but it seems what you actually have to do is:

q
N
:,$s/May/June/gc

Is that the case, or is a better option available?

2

Another approach is something like this:

/MAY Enter cgn JUNE Esc

Then use n to go forward, or N to go back, and . to replace.

| improve this answer | |

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.