Managed search and replace in many files using Vim and ag.

Posted on Mon 16 November 2015 in Programming • Tagged with vim, agLeave a comment

Recently I faced an interesting problem. I had to search for the redundant lines of code (about a hundred occurences), and replace some of them. The bad thing is that I couldn’t do that automatically, as each case had to be manually reviewed.

So, how to automate this task, while keeping the manual control?

Continue reading