vim: support named registers
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: https://github.com/zed-industries/zed/issues/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:
viwywviwpreplace cat w/ bat. Now register is "cat" (egwviwpreplaces "data" with "cat").
Named registers should not do this. They should keep the value.
- Text "bat cat data"
- Normal mode over bat:
viw"aywviw"apreplace cat w/ bat. Now register "a" should remain "bat" (egwviw"apshould replace "data" with "bat").
Zed vim appears to overwrite the register on paste.
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.
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.
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.
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.
Please we need the registers feature... help Zed team.
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.
Thank you