Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to replace specified word in vim

Tags:

vim

when I search for a word there could be many matchings but I just want to replace some of them so use

/keyword

and

n

I can visit each matching

is there any method to visit each matching and then decide whether to replace it or not?

like image 492
user1769686 Avatar asked Jun 30 '26 04:06

user1769686


1 Answers

This:

:%s/keyword/replacement/gc
like image 158
Bill Lynch Avatar answered Jul 01 '26 16:07

Bill Lynch