vimcopyappendclipboard

How to append to the clipboard


I know how to copy to the clipboard but how can I append to it?

I use this in my code:

let @+ =  my_expression

but that overwrites the clipboard.

I know that I can use the registers a-z to append to:

let @B = my_expression

which appends to register b, but what do I when I want to append to the clipboard?


Solution

  • use:

    let @+ = @+ . my_expression
    

    or shorter:

    let @+ .= my_expression
    

    Reference: :help :let.=