Convert Ruby 1.8 style hash rockets to Ruby 1.9 hashes in Vim
nmap <Leader>h :s/\:\([a-zA-Z_]*\)\s=>/\1\:/g<cr>
vmap <Leader>h :'<,'>s/\:\([a-zA-Z_]*\)\s=>/\1\:/g<cr>
then \h (or whatever you have mapleadered) will convert all the 1.8 style hashes on a line to 1.9 style hashes. If you're in visual mode, it will convert all the hash rockets in a selection
Written by Ryan Rix
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#