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
41.6k stars 2.17k forks source link

Nicer multi-key mappings #12539

Open justDeeevin opened 1 month ago

justDeeevin commented 1 month ago

Check for existing issues

Describe the feature

In #4189, support was added for keymaps to multiple keys in succession, pursuing a j k keymap to exit insert mode in Vim mode. While this feature is very useful on its own, it's still a bit clunky to use.

There are two main suggestions I'd like to make:

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

https://github.com/zed-industries/zed/assets/90054389/548a97ef-79de-4ed6-873f-460e85ed5aa8

justDeeevin commented 1 month ago

I'm open to working on a PR for this myself, but it'd take some time to familiarize myself with the codebase. If I find the time, I suppose.

xzbdmw commented 1 month ago

The currently pending key should be previewed

It seems many vim user is annoyed by that fake char

justDeeevin commented 1 month ago

It seems that many vim user is annoyed by that fake char

It would make sense to make this optional, then.

ConradIrwin commented 1 month ago

@justDeeevin If you want to pair on this, feel free to book time here: https://calendly.com/conradirwin/pairing?month=2024-06

I think it'd be nice to show the pending key, if not in the editor, at least in the status bar (where we show f etc.).

0x2CA commented 6 hours ago

Now hardcoded 1000ms, if you change the configuration will be very good for the delay of jk, but this does not solve the actual problem, in vim in have nowait can solve this problem for example:

inoremap <nowait> jj <ESC>