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

Closed
5tefan opened this issue May 7, 2024 · 7 comments
Closed

vim: support named registers #11511

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

Comments

@5tefan
Copy link
Contributor

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 bug [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
Member

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.

@Gantushig77
Copy link

Please we need the registers feature... help Zed team.

ConradIrwin added a commit that referenced this issue Jun 12, 2024
Release Notes:

- vim: Add support for register selection `"a`-`"z`, `"0`-`"9`, `"-`.
`"_` and `"%`
([#11511](#11511))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
@ConradIrwin
Copy link
Member

Fixed by #12895. There are some more obscure registers that are not yet supported, but please open separate issues if you need those for your workflow.

@Gantushig77
Copy link

Thank you

ming900518 pushed a commit to ming900518/zed that referenced this issue Jun 14, 2024
Release Notes:

- vim: Add support for register selection `"a`-`"z`, `"0`-`"9`, `"-`.
`"_` and `"%`
([zed-industries#11511](zed-industries#11511))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
fallenwood pushed a commit to fallenwood/zed that referenced this issue Jun 18, 2024
Release Notes:

- vim: Add support for register selection `"a`-`"z`, `"0`-`"9`, `"-`.
`"_` and `"%`
([zed-industries#11511](zed-industries#11511))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] vim
Projects
None yet
Development

No branches or pull requests

8 participants