Last active
August 29, 2015 14:05
-
-
Save starrhorne/149bce4ae24548442334 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
" begin script to prevent pase over from replacing the default register | |
" contents | |
function! RestoreRegister() | |
let @" = s:restore_reg | |
return '' | |
endfunction | |
function! s:Repl() | |
let s:restore_reg = @" | |
return "p@=RestoreRegister()\<cr>" | |
endfunction | |
" NB: this supports "rp that replaces the selection by the contents of @r | |
vnoremap <silent> <expr> p <sid>Repl() | |
" END script to prevent pase over from replacing the default register | |
" contents | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment