views:

32

answers:

1

In normal mode I press +* and VIM highlighs the occurences of the word under cursor. How to change for example 2,4-5 (second, fourth and fifth) words in search results with %s command? I know I can use %s and to change the searched word in certain lines, but it is not what I need.

+1  A: 

Assuming you did a find first, you could use

:%s//replaced/gic

It will ask for each replacement if it needs to be done.

Lieven