When use neovim to copy content to system clipboard with "+y way. It works well if neovim's window doesn't close, if I close neovim window, the content of + register will disappear. for example, then if I use tow neovim, one copy someword, another can paste easily, but is the copy none close window, then paste one's :reg will show in "+ line: clipboard: error: Error: target STRING not available This happens after I cp the whole /home to /mnt/home, and rm /home, then reboot I found the issue.
I try to reinstall xclip and neovim, didn't work. But install xsel(before I didn't install) and uninstall xclip could slove this issue. However, my tmux will use 'xclip -in -selection clipboard' So, I can't use my tmux to copy into system board. Reinstall the xclip, the neovim will choose the xclip automatically, then the clipboard broken again. I believe this can be solved, hoping someone can solve the problem, fix the xclip issue, or provide some suggestion about tmux set xsel.
There is an open xclip issue related to
Error : target STRING not available
https://github.com/astrand/xclip/issues/38.I recommend switching from
xclip
toxsel
. Neovim now prefersxsel
overxclip
due to reports of issues. See pull request https://github.com/neovim/neovim/pull/9302.You should check your Neovim version. The change to prefer
xsel
overxclip
was introduced in Neovimv0.9.0
.If you can't upgrade to
v0.9.0
then you can override the clipboard provider by setting theg:clipboard
. See https://neovim.io/doc/user/provider.html#g%3Aclipboard for details on how to do that.