Give vi_normal mode's cut/paste access to the system clipboard
Is there any interest in allowing vi_normal mode to the use the system clipboard, rather than its own isolated clipboard? I realize this might require third-party support from something like xclip, but it could be a nushell configuration option, similar to how it works in neovim.
This feature would likely be more useful if a y->yank keybinding were added to vi_normal mode as well.
I'm pretty new here, so apologies if these requests have been addressed in the past. I couldn't find anything by searching. Thanks.
I'm guessing that if it doesn't already, it wouldn't be too tricky to add since reedline already uses the aboard crate.
https://github.com/nushell/reedline/blob/f2447364b923eaab55f6de4f73c1f79511c6b5eb/Cargo.toml#L16
To clarify: which operations in your mind should touch the system clipboard?
- Should every operation (e.g.
dd,x) reach into the clipboard - Just a subset (
y...as explicit copy, how wouldpwork then?) - We implement a vim register system as well and you should use
"+<operation touching the cb>like"+yyfor system clipboard accesss while keeping a separate register for the standard operations.
I think as a ton of basic editing ops (deletions) move content into vim internal "clipboards", sharing this with the system clipboard may be quite surprising or annoying depending on the situation.
This seems like a fair point. For anyone currently using vim mode, it would be disruptive if various editing operations suddenly started interacting with the system clipboard.
On vim, there's a single line in the configuration that can be used to specify that you'd like it to use the system clipboard. Something similar could make sense for reedline/nushell, with the option off by default. If the user chose to enable the option, I would think that all commands (even d and x) would use the system clipboard, to avoid any confusion.
set clipboard^=unnamedplus is a very uncontroversial and popular built-in configuration used by many vim users, which automatically shares the unnamed register with the system clipboard.
I don't really see how it'd be surprising, as long as it's implemented correctly. There isn't really any reason to bikeshed here, you can just follow what vim has been doing for years.