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

Give vi_normal mode's cut/paste access to the system clipboard #745

Open
mister-drgn opened this issue Feb 5, 2024 · 3 comments
Open

Give vi_normal mode's cut/paste access to the system clipboard #745

mister-drgn opened this issue Feb 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mister-drgn
Copy link

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.

@mister-drgn mister-drgn added the enhancement New feature or request label Feb 5, 2024
@fdncred
Copy link
Collaborator

fdncred commented Feb 5, 2024

I'm guessing that if it doesn't already, it wouldn't be too tricky to add since reedline already uses the aboard crate.

arboard = { version = "3.3.0", optional = true, default-features = false, features = ["wayland-data-control"] }

@sholderbach
Copy link
Member

sholderbach commented Feb 14, 2024

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 would p work then?)
  • We implement a vim register system as well and you should use "+<operation touching the cb> like "+yy for 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.

@mister-drgn
Copy link
Author

mister-drgn commented Feb 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants