Skip to main content
Swapped x to 0.
Source Link

I made a keymap which I use for appending. It yanks to the 'x''0' register which is actually the default for yank and then appends it to your '+' register.

vnoremap <leader>y <Cmd>call AppendYank()<CR>

function! AppendYank()
    normal! "xy"0y
    call setreg('+', getreg('+') . getreg('x''0'), getregtype('+'))
endfunction

I made a keymap which I use for appending. It yanks to the 'x' register which is actually the default for yank and then appends it to your '+' register.

vnoremap <leader>y <Cmd>call AppendYank()<CR>

function! AppendYank()
    normal! "xy
    call setreg('+', getreg('+') . getreg('x'), getregtype('+'))
endfunction

I made a keymap which I use for appending. It yanks to the '0' register which is the default for yank and then appends it to your '+' register.

vnoremap <leader>y <Cmd>call AppendYank()<CR>

function! AppendYank()
    normal! "0y
    call setreg('+', getreg('+') . getreg('0'), getregtype('+'))
endfunction
Source Link

I made a keymap which I use for appending. It yanks to the 'x' register which is actually the default for yank and then appends it to your '+' register.

vnoremap <leader>y <Cmd>call AppendYank()<CR>

function! AppendYank()
    normal! "xy
    call setreg('+', getreg('+') . getreg('x'), getregtype('+'))
endfunction