cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

neovim: copy/paste actions are broken on linux

Open fidgetingbits opened this issue 1 year ago • 2 comments

Right now the setter and getter for clipboard uses the * register, where as the paste() function in utils.lua uses the + register. Although both are clipboard associated, I don't think they are always interchangeable. Using a bare config neovim instance, like the development init.lua pokey added, pasting a copied token doesn't work on linux (also doesnt work with my main config). I can see that the copied value is set in * using :reg though.

I'm not sure yet how best to fix this, but will look into it.

Worth noting that stuff like bring works fine, but I'm guessing that doesn't use the clipboard, or if so only stashes the data in * register and never relies on the paste() function in utils.

fidgetingbits avatar Jun 25 '24 04:06 fidgetingbits

Do you think the fix should just be about using the * register for all operations (instead of using the + register)?

I have these in my personal init.lua so it might help fixing/debugging:

vim.cmd [[
" system clipboard
nmap <c-c> "+y
vmap <c-c> "+y
nmap <c-v> "+p
inoremap <c-v> <c-r>+
cnoremap <c-v> <c-r>+
" use <c-r> to insert original character without triggering things like auto-pairs
inoremap <c-r> <c-v>
"Enable CTRL-V in terminal mode
tnoremap <c-v> <C-\><C-N>"+pi
]]

saidelike avatar Jul 17 '24 11:07 saidelike

@fidgetingbits can you give an example of voice command that would not work as you would expect on Linux? copy first paint does work for me on Windows with the development init.lua

saidelike avatar Jul 17 '24 13:07 saidelike