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

vim: support named registers #11511

Open
5tefan opened this issue May 7, 2024 · 4 comments
Open

vim: support named registers #11511

5tefan opened this issue May 7, 2024 · 4 comments
Labels
defect [core label] vim

Comments

@5tefan
Copy link

5tefan commented May 7, 2024

Description

Edit: Zed vim does not support named registers. Named registers currently read and write from the primary clipboard -- the same one as ⌘C/⌘V or y/p.

A previous issue about vim registers was incorrectly closed: #1507


(Originalish text): In vim, pasting from the default register copies the overwritten value to the default register.

  • Text "bat cat data"
  • Normal mode cursor over bat: viwywviwp replace cat w/ bat. Now register is "cat" (eg wviwp replaces "data" with "cat").

Named registers should not do this. They should keep the value.

  • Text "bat cat data"
  • Normal mode over bat: viw"aywviw"ap replace cat w/ bat. Now register "a" should remain "bat" (eg wviw"ap should replace "data" with "bat").

Zed vim appears to overwrite the register on paste.

@5tefan 5tefan added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels May 7, 2024
@baldwindavid
Copy link
Contributor

baldwindavid commented May 7, 2024

I don't believe Zed has any concept of vim registers at all. I have seen mention of them here and there (not sure why that got marked completed actually), but don't know that there is a tracking issue for them. I'd love to see some form of register support as a single copy/paste slot has been limiting.

@dancojocaru2000
Copy link

Not having registers is quite a big problem for me because the "use_system_clipboard" option is all or nothing: either I use the system clipboard or I don't. I very much prefer Vim's way of doing things, where by default I don't use the system clipboard, but if I prefix some action with "+ then I do.

@ConradIrwin ConradIrwin changed the title vim: paste from named register overwrites register vim: support named registers May 8, 2024
@ConradIrwin
Copy link
Collaborator

Looks like #1507 shouldn't have been closed. Retitling this to make it clearer it's a feature request.

If anyone would like to pair with me on this, feel free to book time: https://calendly.com/conradirwin/pairing.

cc @Zachiah who mentioned he'd like to take a go at this.

@Moshyfawn Moshyfawn added vim and removed triage Maintainer needs to classify the issue labels May 8, 2024
@JosephTLyons JosephTLyons removed the admin read Pending admin review label May 9, 2024
@jagill
Copy link

jagill commented May 14, 2024

This is currently my most-missed feature of Zed's vim support. I find myself reflexively trying to use registers, which does not work. In particular, if I've highlighted the region, then type " + a + d, it replaces the highlighted region with "ad, which looks like it works (since lots of text was replaced by very little text, which looks like deletion), but when I then paste I get whatever happens to be in my clipboard, which is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] vim
Projects
None yet
Development

No branches or pull requests

7 participants