Created
May 8, 2012 13:22
-
-
Save brendanjerwin/2634935 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! Refactor() | |
| call inputsave() | |
| let @z=input("What do you want to rename '" . @z . "' to? ") | |
| call inputrestore() | |
| endfunction | |
| " Locally (local to block) rename a variable | |
| autocmd FileType coffee nmap <buffer> <Leader>rr "zyiw:call Refactor()<cr>mx:silent! norm gd<cr>Vii%:s/<C-R>//<c-r>z/g<cr>`x | |
| autocmd FileType javascript nmap <buffer> <Leader>rr "zyiw:call Refactor()<cr>mx:silent! norm gd<cr>[{V%:s/<C-R>//<c-r>z/g<cr>`x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment