Convert Ruby 1.8 to 1.9 hash syntax
nnoremap <Leader>: :%s/:\([^ ]*\)\(\s*\)=>/\1:/gc<CR>
Add whitespace inside of braces {}
nnoremap <Leader>{ :%s/{\([^ ]\)/{ \1/gc<CR>
nnoremap <Leader>} :%s/\([^ ]\)}/\1 }/gc<CR>
As these are not commonly used, it may be more appropriate to add them into a separate file, say ~/.vimrc.refactoring
, and that file when needed to the current vim session:
source ~/.vimrc.refactoring