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.