Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Neoclip: multi-platform clipboard provider w/o extra dependencies #14706

Open
matveyt opened this issue Jun 2, 2021 · 2 comments
Open
Labels
clipboard clipboard, paste enhancement feature request
Milestone

Comments

@matveyt
Copy link
Contributor

matveyt commented Jun 2, 2021

This is a request for comments for my project Neoclip.

As we all know, Neovim had dropped all system-specific code to access clipboard. While it was a flexible design, but it led to several common problems the users seem to encounter all the time: need for extra utlities or specific GUIs; poor performance under some circumstances; unreliable detection of Visual-Blocks and such. There were some attempts to resolve this problem, like this or this, but none is complete and ready for use.

So I present my solution: it is a plugin and several binary extension modules for major platforms providing uniform API to access system clipboard. The project state is as follows:

  • multi-platform: Windows, macOS, X11 and Wayland;
  • pure plugin, no patches to Neovim needed;
  • only essential dependencies, such as wayland-client; no special utilities, GUIs, fat toolkits etc.
  • Vim-compatible custom clipboard formats for all platforms; able to detect Visual-Blocks;
  • X11: support for rare features like INCR; can paste >256K from Gtk apps;
  • No binaries at the moment, so user must build from source
  • Not enough testing and user experience;
  • Wayland: wlr-data-control protocol is required; if it's not available (for example, GNOME/Mutter) Neoclip falls back to X11 module;

So I'd be glad to get any feedback from all of you. If you think it's a good addition to your plugin collection; or maybe it's even worth shipping Neoclip as default plugin with Neovim runtime; or maybe you can spot some bugs and so on.

Thank you!

@janlazo janlazo added enhancement feature request clipboard clipboard, paste labels Jun 3, 2021
@bfredl
Copy link
Member

bfredl commented Jun 4, 2021

Interesting work. We could avoid the threading of X11 by using the fast_events uv loop. this could be accessed via lua, though we could expose the uv handle to C code directly.

@matveyt
Copy link
Contributor Author

matveyt commented Jul 9, 2021

We could avoid the threading of X11 by using the fast_events uv loop.

I don't see how this could be done from inside a shared object, unless something would've been exported to Lua global namespace.

@justinmk justinmk added this to the unplanned milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clipboard clipboard, paste enhancement feature request
Projects
None yet
Development

No branches or pull requests

4 participants