Skip to content

Instantly share code, notes, and snippets.

@comeonly
Last active December 15, 2015 07:49
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 comeonly/5226320 to your computer and use it in GitHub Desktop.
Save comeonly/5226320 to your computer and use it in GitHub Desktop.
" replace
" For function argument with comment header
nnoremap <leader>ra viwy?^[\ta-z ]*\<function\><CR>/{<CR>%v%V[/:s/\V<C-r>"//gc<left><left><left>
" For variable in function
nnoremap <leader>rf viwy?^[\ta-z ]*\<function\><CR>/{<CR>%v%V:s/\V<C-r>"//gc<left><left><left>
" For local replace
nnoremap <leader>rl gd[{V%:s/<C-R>///gc<left><left><left>
" For global replace
nnoremap <leader>rg gD:%s/<C-R>///gc<left><left><left>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment