If I copy text into the xterm clipboard ("+y
) from gvim, it is cleared when I exit gvim.
How do I prevent this?
I've found the solution for vim, but it doesn't work for Gvim:
autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib")
https://superuser.com/questions/299419/prevent-vim-from-clearing-the-clipboard-on-exit
autocmd
: stackoverflow.com/a/9381778/2072269. Related: Can Vim add to the X11 clipboard or primary buffers without an external utility?.