-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add Vim-like Which-key Popup menu #43618
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
Add Vim-like Which-key Popup menu #43618
Conversation
|
only if vim is enable right? |
Yes, |
This is cool! Would it be hard to support non-vim/helix mode? The are plenty of “compound” bindings in regular mode, as well as in the emacs key map, that could be exposed this way. Eg |
4e6660f to
3d06b53
Compare
| // Hard-coded list of keystrokes to filter out from which-key display | ||
| pub static FILTERED_KEYSTROKES: LazyLock<Vec<Vec<Keystroke>>> = LazyLock::new(|| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a followup, maybe a good heuristic would be to:
- Enumerate all possible actions
- Choose the binding with the fewest keys for each action and show only that.
In case of a tie, I think it's okay to show more than one keybind.
|
Hi @ConradIrwin , thank you so much for your prompt review. Here is my answers for your comments:
BTW, if you have any extra time, can you have a quick look for my follow up PR #43949? From the high level, I am not sure that is the direction for Zed team want on the current roadmap, but having some customization/renaming capabilities would be great for next level user experiences (if not that should be great for a future PR). But like I mentioned in the parent issue #10910 (comment), that PR would be just a "add the finishing touch". Therefore, feel free to close either one of them so that we can just target one direction.
Thanks again for taking your time here. |
a42a135 to
9598519
Compare
This prevents the dialogue flashing open if there are conflicting bindings
151d712 to
10b8076
Compare
|
I was testing this out on my local machine and noticed that pressing Thanks for all the work you are putting into this and really looking forward to getting this feature. |
|
Hi @avbm , thanks for reporting this. However, this is not an issue with the which-key system, instead the root cause is that we have the default key mapping in zed for {
"context": "(VimControl && !menu)",
"bindings": {
"space": null, // Disable the default action vim::WrappingRight
},
} |
|
Yep, that did the trick - thanks. |
Closes #10910 Follow up work continuing from the last PR #42659. Add the UI element for displaying vim like which-key menu. https://github.com/user-attachments/assets/3dc5f0c9-5a2f-459e-a3db-859169aeba26 Release Notes: - Added a which-key like modal with a compact, single-column panel anchored to the bottom-right. You can enable with `{"which_key": {"enabled": true}}` in your settings. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Closes #10910 Follow up work continuing from the last PR #42659. Add the UI element for displaying vim like which-key menu. https://github.com/user-attachments/assets/3dc5f0c9-5a2f-459e-a3db-859169aeba26 Release Notes: - Added a which-key like modal with a compact, single-column panel anchored to the bottom-right. You can enable with `{"which_key": {"enabled": true}}` in your settings. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
I might be doing something wrong, but pressing
|
|
Great contribution, thank you! Any plans to make the position of the popup menu configurable? |
|
@Wozacosta I had to remove the context for it to work for me (I also tried replacing it with settings.json keymap.json |
{
"context": "(VimControl && !menu)",
"bindings": {
"space": null, // Disable the default action vim::WrappingRight
},
},also works |
Closes zed-industries#10910 Follow up work continuing from the last PR zed-industries#42659. Add the UI element for displaying vim like which-key menu. https://github.com/user-attachments/assets/3dc5f0c9-5a2f-459e-a3db-859169aeba26 Release Notes: - Added a which-key like modal with a compact, single-column panel anchored to the bottom-right. You can enable with `{"which_key": {"enabled": true}}` in your settings. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Closes zed-industries#10910 Follow up work continuing from the last PR zed-industries#42659. Add the UI element for displaying vim like which-key menu. https://github.com/user-attachments/assets/3dc5f0c9-5a2f-459e-a3db-859169aeba26 Release Notes: - Added a which-key like modal with a compact, single-column panel anchored to the bottom-right. You can enable with `{"which_key": {"enabled": true}}` in your settings. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>



Closes #10910
Follow up work continuing from the last PR #42659. Add the UI element for displaying vim like which-key menu.
Screen.Recording.2025-11-26.at.2.08.22.PM.mov
Release Notes:
{"which_key": {"enabled": true}}in your settings.