Skip to content

Instantly share code, notes, and snippets.

@kdisneur
Created August 2, 2016 20:38
Show Gist options
  • Save kdisneur/5cd95d68f49876594037c5f8ca872c77 to your computer and use it in GitHub Desktop.
Save kdisneur/5cd95d68f49876594037c5f8ca872c77 to your computer and use it in GitHub Desktop.
" ~/.vimrc
vmap <Leader>ocd :ObsessiveCompulsiveDisorder<cr>
vmap <Leader>ro :OldToNewHash<cr>
vmap <Leader>t <Plug>(EasyAlign)
" ~/.vim/after/ftplugin/ruby.vim
function! s:ObsessiveCompulsiveDisorder() range
exec a:firstline . ',' . a:lastline . 'OldToNewHash'
exec a:firstline . ',' . a:lastline . 'EasyAlign :'
endfunction
command! -range ObsessiveCompulsiveDisorder <line1>,<line2>call s:ObsessiveCompulsiveDisorder()
command! -range OldToNewHash <line1>,<line2>s/:\([a-zA-Z-0-9_]\+\)\s*=>/\1:/g
" ~/.vim/after/ftplugin/scss.vim
function! s:ObsessiveCompulsiveDisorder() range
exec a:firstline . ',' . a:lastline . 'sort'
exec a:firstline . ',' . a:lastline . 'EasyAlign :'
endfunction
command! -range ObsessiveCompulsiveDisorder <line1>,<line2>call s:ObsessiveCompulsiveDisorder()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment