zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.1k stars 2.71k forks source link

cut-buffer / yank support for ctrl-k and ctrl-y #14260

Open notpeter opened 2 months ago

notpeter commented 2 months ago

Check for existing issues

Describe the feature

MacOS supports a readline/emacs style cut buffer using ctrl-k (cut to end of line) and ctrl-y (yank from cut buffer). This buffer is buffer should be distinct from the clipboard to enable the ability to use both simultaneously. Currently Zed deletes ctrl-k is bound to editor::CutToEndOfLine which puts the contents on the clipboard.

This is support pretty much universally in MacOS applications (all common controls, text fields, notes app, chrome text area & location bar). Basically everywhere. Except Zed!

To be really fancy one could implement multiple cut buffers like the emacs kill ring. MacOS does not support this, but in emacs this is done via ctrl-y to yank, then alt-y one or more times to cycle back through your earlier cuts.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

jph00 commented 1 month ago

Also, when using vim compatible mode in Zed, the default yank register is currently the system clipboard, which makes Zed unusable for me. Vim uses the * or + registers as the system clipboard (details: https://stackoverflow.com/questions/3961859/how-to-copy-to-clipboard-in-vim), and they should not be the default.