I personally don't like the Neovim approach for several reasons:
- it puts the burden to configure the clipboard to the users. Yes, I
know we can ship pre-configured clipboard provider, but initially this
has to be configured by each user separately (and then later
eventually merged into Vim)
- I think, the clipboard functionality should work out of the box. There
is a reason, why no other application uses a clipboard provider
feature but implements this directly in the application
- I think shelling out to an external clipboard provider causes a
performance penalty, especially when pasting large amount of texts
(a few years ago, we had an issue when using `:g/../d` which caused
a huge slowdown, just because Vim was copying each delete into the X11
clipboard. We added some logic to prevent this, but using a clipboard
provider would make this experience worse)
- There are too many corner cases that need to be considered:
- different encodings of the text being pasted
- different selection types (character- block- or linewise)
- It doesn't help with Vim tiny, since it doesn't support Vim script, so
one should still need to re-compile Vim
- If you are using xclip or xsel you would still require the X11
libraries to work with the clipboard, so I don't think this gains us
anything
There are probably a few others, e.g. in my professional work, I have to
jump to customer environments and work with what is installed there. I
cannot start configuring clipboard provider (or install additional
tools) just to do my work there. In addition, I am not sure, how this
would work on containers and similar environments.
I suppose if one really wants to, users can already make use of
clipboard providers using some Vim plugin (with the restrictions
mentions above), there shouldn't be anything hindering you to use
external tools to interact with the clipboard already. That doesn't
mean, we should get rid of the existing clipboard code however. I am not
sure if such a Vim plugin exists.
> 2. Create our own implementation for dealing with the system clipboard
> without rely on X11
>
> Advantages:
> - The user is ready to go without needing to install anything
> - There shouldn't be a big performance loss
>
> Disadvantages:
> - Maintenance in theory will be more difficult since I assume is not an
> easy task to support all vim's targets while still support some
> more esoteric/less common setups.
Clipboard functionality is a feature of X11. I don't see how we could
support this without X11 libraries available. I suppose Wayland supports
something similar, but the fact remains, we need to connect to some
existing frame work that enables the inter-process communication. We
cannot just develop our own here.
Thanks,
Christian
--
I hear what you're saying but I just don't care.