Does using xclip as a custom clipboard work (see :h clipboard)?
vim.g.clipboard = {
name = 'xclip',
copy = {
['+'] = { 'xclip', '-quiet', '-i', '-selection', 'clipboard' },
['*'] = { 'xclip', '-quiet', '-i', '-selection', 'primary' },
},
paste = {
['+'] = { 'xclip', '-o', '-selection', 'clipboard' },
['*'] = { 'xclip', '-o', '-selection', 'primary' },
},
cache_enabled = 1, -- cache MUST be enabled, or else it hangs on dd/y/x and all other copy operations
}
I’m using this with vim.opt.clipboard = 'unnamedplus' to sync clipboards and it’s working without issue.
By the way, you can just run :checkhealth clipboard so you don’t check everything else, which might take some time depending on which plugins you have installed.
I think the main issue is that the clipboard registers aren’t working as both tools seem to be detected correctly according to the original post.
I’m also suspecting this could be caused by plugins, which we can check by running nvim with no config:
nvim --clean
PS: I just want to note that I’ve had issues with wl-clipboard lately in which copying/pasting became very laggy at random times, which is why I’ve opted to using to xclip instead.
If you have both installed in your system, this is how they’re picked by default, according to :h clipboard:
Nvim looks for these clipboard tools, in order of priority: