Recently found out my apps aren't working due to FactoryGirl changes. I've honestly felt more comfortable using Textmate until I tried its find and replace feature. It totally works but it is so slow.

VIM is a lot faster.

This is what I did to replace Factory( with FactoryGirl.create

cd features/step_definitions/

To open all files within step_definitions directory:

vim -p *  

To make sure changes will be written to all files open:

:set autowriteall

:bufdo %s/Factory(/FactoryGirl.create(/ge

There's probably an easier way to say that. Be careful about using autowrite. I think there are cases wherein changing every file is better.

Of course those Windows users using Agent Ransack will probably LOL.

The VIM documentation offers a better explanation about the commands.

Read: Run a command in multiple buffers

comments powered byDisqus

Hello! I am Kat. I've been a developer for several years. When I'm not sitting down, reading and working for long hours, I am traveling to some place of interest.
If you want to reach out, you can send me an email or add me up on Google Plus.