cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.13k stars 79 forks source link

neovim: copy/paste actions are broken on linux #2452

Open fidgetingbits opened 3 months ago

fidgetingbits commented 3 months ago

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.

saidelike commented 2 months ago

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 commented 2 months ago

@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