Vim: Use + as default register only for yank command
问题 I'd like to use + register (system clipboard) only for yank command (that is, don't overwrite this register on dd or other commands). :set clipboard+=unnamed won't work, because it introduces dd overwriting described above. 回答1: You can overwrite the default yank commands so that they default to the system clipboard, unless another register is explicitly given: :nnoremap <expr> y (v:register ==# '"' ? '"+' : '') . 'y' :nnoremap <expr> yy (v:register ==# '"' ? '"+' : '') . 'yy' :nnoremap <expr