VIM find all occurrences and replace with input

Viewed 899

Is it possible to search a file for the occurrences of a specific word and ask the user for input to replace this word with. Do the same thing over again, either typing in a new replacement or using something from your history, until all the words are replaced or the user quits. Keep in mind that I want to have the choice to skip over words I don't want to replace.

Just using

:%s/value_one/value_two/gc

would mean I have to execute this command for each different replacement I have in mind. Is this possible or is there something wrong with this workflow. I would use this when pasting boilerplate code that only need one variable to be changed.

2 Answers
Related