
貌似木有办法,或者我不知道
建议复制粘贴剪切啥的,都用系统的剪贴板,参考:
" Cut
vnoremap <C-X> "+x
vnoremap <BS> s
" Copy, use CTRL-Break to cancel an operation
vnoremap <C-C> "+y
inoremap <C-C> <Nop>
" Use CTRL-Q to do what CTRL-V used to do
noremap <C-Q> <C-V>
" Paste, use CTRL-V
nnoremap <C-V> "+p
vnoremap <C-V> "+p
nnoremap ,<C-V> "+P
" Use Paste() to toggle 'paste' option, or the indent of the paste content
" will be a mess.
inoremap <C-V> <C-O>:call Paste("beforePaste")<CR>
\<C-R>+<C-O>:call Paste("afterPaste")<CR>
cnoremap <C-V> <C-R>+
" Indent last pasted contents
nnoremap <F9> '[v']=']
inoremap <F9> <ESC>'[v']=']a
" Select all
noremap <C-A> ggVG
inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
cnoremap <C-A> <C-C>gggH<C-O>G
onoremap <C-A> <C-C>gggH<C-O>G
snoremap <C-A> <C-C>gggH<C-O>G
xnoremap <C-A> <C-C>ggVG
" Undo && Redo
noremap <C-Z> u
inoremap <C-Z> <C-O>u
noremap <C-Y> <C-R>
inoremap <C-Y> <C-O><C-R>
" Toggle paste options, make insert mode paste(Ctrl-V) behaves correctly.
function! Paste(mode)
if a:mode == "beforePaste"
let b:pasteOpt = &paste
set paste
elseif a:mode == "afterPaste"
if !exists("b:pasteOpt")
return
endif
let &paste = b:pasteOpt
unlet b:pasteOpt
endif
endfunction