I have been looking for efficient solution how to refractor code with Vim for a while,
so I’d like to share it with you. That’s an extremely easy:

  1. Search (Tool from Vim):

:Ack OldClassName **/*.rb **/*.rake

  1. Apply changes on results (optional):

:cdo g/OldClassName/s/OldClassName/NewClassName/ge

  1. Update and save at once:

:cdo %s/OldClassName/NewClassName/ge | update

Big thanks to Sebastian for sharing this trick with me.

Check out his blog post Should You start using VIM?

Big up!