Skip to content

Instantly share code, notes, and snippets.

@JoeWoodward
Created March 10, 2014 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeWoodward/9462600 to your computer and use it in GitHub Desktop.
Save JoeWoodward/9462600 to your computer and use it in GitHub Desktop.
Convert ruby to new syntax using vim. <leader>frs short for format ruby syntax
# format ruby syntax
# :symbol => 'with rocket'
# will be converted to
# symbol: 'without rocket'
function! s:FormatRuby()
silent! execute '%s/:\(\w\+\)\ =>/\1: /g'
endfunction
command! -range=% frs call <SID>FormatRuby()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment