-
-
Save dtuite/a89d3a1083c0b4f9a669 to your computer and use it in GitHub Desktop.
Useful Ruby Vim Macros
El3xi:^[bhx
Turn a rocket style symbol hash into Ruby 1.9 syntax.
Example:
my_method(:hello => 'something')
Run this macro with the cursor on the colon to get:
my_method(hello: 'something')
You can do this to all hashes in a file at once with the following mapping:
nnoremap <leader>s :%s/:\([a-z_]*\)\s=>/\1:/g<cr>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment