I'm in the process of converting a lot of 1.8 style hashes into 1.9 style. This is frustratingly slow to do. Of course, not really because I have vim. If you find yourself in this situation, and have a file open with a lot of these in it of the form:

render :partial => 'foo', :locals => { :giggity => 'goo' }

You can just throw this handy regex into vim for maximum awesomeness (also, if you haven't used backreferences/capture in vim, note that I have to escape the parens):

%s/:\([a-zA-Z]*\) =>/\1:/g

That'll leave you with what you want:

render partial: 'foo', locals: { giggity: 'goo' }

Anyway, I am hopeful that Nick will rebound this post with one about doing the same thing project-wide using sed. Or someone else will generate a less-specific version, that handles string keys as well at least :)

Josh Adams is a developer and architect with over eleven years of professional experience building production-quality software and managing projects. Josh is isotope|eleven's lead architect, and is responsible for overseeing architectural decisions and translating customer requirements into working software. Josh graduated from the University of Alabama at Birmingham (UAB) with Bachelor of Science degrees in both Mathematics and Philosophy. He runs the ElixirSips screencast series, teaching hundreds of developers Elixir. He also occasionally provides Technical Review for Apress Publishing, specifically regarding Arduino microprocessors. When he's not working, Josh enjoys spending time with his family.