开发者

GVIM. How to change certain words that match the pattern?

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 ca开发者_如何学JAVAn use %s and to change the searched word in certain lines, but it is not what I need.


Assuming you did a find first, you could use

:%s//replaced/gic

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜