Add set clipboard=unnamed
to your .vimrc
. So it will use the clipboard register '*' instead of the unnamed register for all yank, delete, change and put operations (note it does not only affect the mouse).
The behavior of register '*' depends on your platform and how your vim
has been compiled (or if you use neovim
).
If it does not work, you can try with set clipboard=unnamedplus
, but this option only makes sense on X11 systems (and gvim therefore).