Skip to content

Instantly share code, notes, and snippets.

@hokaccha
Created April 10, 2010 06:10
Show Gist options
  • Save hokaccha/361864 to your computer and use it in GitHub Desktop.
Save hokaccha/361864 to your computer and use it in GitHub Desktop.
" コピペ
nnoremap y "xy
vnoremap y "xy
nnoremap d "xd
vnoremap d "xd
nnoremap c "xc
vnoremap c "xc
vnoremap p "xp
nnoremap <C-p> :<C-u>set opfunc=OverridePaste<CR>g@
nnoremap <C-p><C-p> :<C-u>set opfunc=OverridePaste<CR>g@g@
function! OverridePaste(type, ...)
if a:0
silent execute "normal! `<" . a:type . "`>\"xp"
elseif a:type == 'line'
silent execute "normal! '[V']\"xp"
elseif a:type == 'block'
silent execute "normal! `[\<C-V>`]\"xp"
else
silent execute "normal! `[v`]\"xp"
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment