Monday, May 7, 2012

Search and replace words in multiple files in Vim

Upgraded my project's factory girl and got some nasty warnings about Factory(:xxx) and Factory.create(:xxx) syntax being deprecated. I've been using the former for almost all of the specs so needed an easy way to search and replace words in multiple files in Vim.

:args app/models/*
:argdo %s/Factory(:/FactoryGirl.create(:/ge | update

No comments: