helix icon indicating copy to clipboard operation
helix copied to clipboard

Add support for configuring clipboard used for mouse yank

Open apanloco opened this issue 1 year ago • 3 comments

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.

apanloco avatar May 31 '23 08:05 apanloco

Very useful feature, hope it can be merged 🙏

Dreamacro avatar Jun 21 '23 12:06 Dreamacro

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.

apanloco avatar Nov 21 '23 15:11 apanloco

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.

the-mikedavis avatar Nov 27 '23 13:11 the-mikedavis