Closed NEX-S closed 1 year ago
vim.o.clipboard
is only used as a fallback (if specified) when focus change events (FocusGained
and FocusLost
) are not supported. Otherwise I'm currently using getreg
and setreg
functions to copy content between the system clipboard and the unnamed register.
Anyway if I understand you correctly: You're proposing using let @"=@+
and let @+=@"
instead of the current implementation (vim.fn.setreg('"', vim.fn.getreg('+'))
and vim.fn.setreg('+', vim.fn.getreg('"'))
), but I don't see any benefit. Okay, it's less characters but from my tests the performance is basically the same and using lua
gives more flexibility.
Why do you think your solution would be better? Unless using command
in autocommand
is faster than using callback
, but it's hard to reliably test that, and I'm not sure if it's worth it.
The real performance bottleneck is most likely the call to clipboard integration provider (like win32yank
on Windows). I believe removal of redundant calls to it, as this plugin aims to do, is enough. Of course I'm open to critique and suggestions, also those regarding performance.
got it :)
hi, after reading your code, i got a idea:
this works fine for me, but it seems you are using
vim.o.clipboard=unnamedplus
to sync the clipboard, so I'm wondering if we can just sync the register butvim.o.clipboard
?is there any benefit from setting the
vim.o.clipboard
?appreciate for your reply sir :)