helix
helix copied to clipboard
Add support for configuring clipboard used for mouse yank
Adds mouse_yank_clipboard configuration option under the editor section:
[editor] mouse-yank-clipboard = "system" / "primary" (default "primary")
This affects the following actions:
- Selecting text with mouse will yank to configured clipboard
- Pasting with middle mouse button will use configured clipboard
- Replacing selected text with ALT+middle mouse button will use configured clipboard
Without this option Helix will fallback to current behavior of using the primary clipboard for the above mentioned actions.
Fixes #6642.
Very useful feature, hope it can be merged 🙏
Rebased, and made sure it still works. The wording of Primary and System might not be very relevant any longer, since the message is now "yanked ... to register * / +". Not sure though.
Instead we could deserialize to a char
and yank to the register at that char. So you could choose between +
/*
but also regular registers like "
(the default yank register) or other special registers like _
(black hole - the yank would be discarded).
So this would be mouse-yank-register
instead.