Picture of Michael Lee
:wave: Hey hey, I'm Michael Lee and this is my site about being a developer, being a dad and making side projects.

Search and replace all instances of a string in Vim

Written on December 8, 2017

Being able to search and replace all instances of a string in a text editor definitely speeds up the editing process. In an editor like Atom, the process is mapped to a keyboard shortcut but I find myself still reaching for the mouse to kick off the Find all and then Replace all process.

With Vim, it’ll take some time to remember the command for search and replace, but I think the implementation is clever and I really dig how to process can all be done without reaching for the keyboard.

Search and replace animation gif

You can even get Vim to provide a confirmation prompt for each instance found and asks whether you want to actually replace it.

Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design and side projects. Sign up and I'll send you my articles straight to your email.