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

Which-Key like menu #10910

Open
1 task done
DissolveDZ opened this issue Apr 23, 2024 · 10 comments
Open
1 task done

Which-Key like menu #10910

DissolveDZ opened this issue Apr 23, 2024 · 10 comments
Labels
discoverability Feedback for discoverability of features, settings, etc enhancement [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc vim

Comments

@DissolveDZ
Copy link
Contributor

DissolveDZ commented Apr 23, 2024

Check for existing issues

  • Completed

Describe the feature

Many vim distros like LazyVim or NvChad and Doom Emacs or even Helix have a Which-Key popup for extra keybinds.
It's extremely useful and you could even have an optional delay so you can complete the combination before it opens, you have a visual UI which tell you which key you can press to open which many for example you press W and then V to go to window settings and split it vertically. I'm currently using Zed as my main text editor and would love to have this feature as it helps a lot and makes it feel really like a Vim alternative.

This could become a crucial part of the Vim workflow and could be really essential to the Zed experience.
Many editors have it as a plugin although some have it built-in, once Zed gets plugin support it might even be implemented through a plugin but I like the native way more

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

These images aren't mine, I just found them on Google but I've tried all of these implementations of which-key.
This might just seem like the command line when pressing : in Zed but it's very different when actually using

Doom Emacs:
image

NvChad:
image

Helix:
image

@JosephTLyons JosephTLyons added vim discoverability Feedback for discoverability of features, settings, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc and removed triage labels Apr 24, 2024
@JosephTLyons
Copy link
Collaborator

This would be useful outside of Vim mode as well, with just the standard bindings, which was suggested here:

@DissolveDZ DissolveDZ changed the title Which-Key like menu for Vim/Helix users Which-Key like menu Apr 25, 2024
@robclancy
Copy link

Yep for me if this had better vim multi cursor (I think I just need to rebind things to get the editors version to work, ctrl+d is being overridden by vim right now), bindings like in doom emacs with whichkey and probably less account/copilot stuff I'd use it as my main editor when not using PHP.

@theherk
Copy link

theherk commented May 16, 2024

Screenshot 2024-05-16 at 12 34 31

Just wanted to add a screenshot of a Neovim mini.nvim mini.clue implementation, which is somewhere between Helix's implementation and which-key. This is just for ideation.

@jellydn
Copy link

jellydn commented Jul 12, 2024

Just a thought, we could have a plugin similar to https://github.com/VSpaceCode/vscode-which-key if Zed could expose APIs.

@benswift
Copy link

Just a +1 for this. One of the things I miss from Emacs is the ability to easily see what a key is bound to in the current context.

I don't even think it needs to have the whole "popup all the possible binding completions" mini-pane; sometimes it's just that I want to add a convenient keybinding for something and I want to make sure I'm not shadowing some other thing which might be useful

@FormalSnake

This comment has been minimized.

@otomist
Copy link

otomist commented Aug 29, 2024

will give this a shot

@bohdanivanchenko
Copy link

This Which-Key style menu would be an incredible addition to Zed! As someone coming from Neovim, I really miss having that visual guide for keybindings at my fingertips. It's not just about remembering shortcuts - it fundamentally changes how you interact with the editor.

Having a Which-Key menu in Zed would:

  1. Dramatically improve discoverability of features and commands
  2. Reduce cognitive load by providing visual cues for complex key sequences
  3. Make it easier for new users to learn and navigate Zed's capabilities
  4. Allow power users to create and organize custom keybinding hierarchies

Importantly, it bridges the gap between command-line efficiency and GUI intuitiveness. You get the speed of keyboard-driven workflows with the discoverability of a graphical interface. This could be a game-changer for Zed, making it even more appealing to developers coming from Vim/Neovim or Emacs backgrounds while still being accessible to those new to modal editing.

The ability to see available options as you type would make Zed feel incredibly responsive and "smart". It's one of those features that, once you've used it, you wonder how you ever lived without it. Implementing this natively would give Zed a significant edge over editors that only offer it via plugins.

@hanumanman
Copy link

Would be great to have visual hints for marks/registers.

image

@MaxistheSpy
Copy link

Id love a which key like menu I keep having to tab back to

zed/assets/keymaps/vim.json

Lines 287 to 337 in ec95a33

// window related commands (ctrl-w X)
"ctrl-w left": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w right": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w up": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w down": ["workspace::ActivatePaneInDirection", "Down"],
"ctrl-w h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w j": ["workspace::ActivatePaneInDirection", "Down"],
"ctrl-w ctrl-h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl-w ctrl-l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl-w ctrl-k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl-w ctrl-j": ["workspace::ActivatePaneInDirection", "Down"],
"ctrl-w shift-left": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-w shift-right": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-w shift-up": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-w shift-down": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-w shift-h": ["workspace::SwapPaneInDirection", "Left"],
"ctrl-w shift-l": ["workspace::SwapPaneInDirection", "Right"],
"ctrl-w shift-k": ["workspace::SwapPaneInDirection", "Up"],
"ctrl-w shift-j": ["workspace::SwapPaneInDirection", "Down"],
"ctrl-w g t": "pane::ActivateNextItem",
"ctrl-w ctrl-g t": "pane::ActivateNextItem",
"ctrl-w g shift-t": "pane::ActivatePrevItem",
"ctrl-w ctrl-g shift-t": "pane::ActivatePrevItem",
"ctrl-w w": "workspace::ActivateNextPane",
"ctrl-w ctrl-w": "workspace::ActivateNextPane",
"ctrl-w p": "workspace::ActivatePreviousPane",
"ctrl-w ctrl-p": "workspace::ActivatePreviousPane",
"ctrl-w shift-w": "workspace::ActivatePreviousPane",
"ctrl-w ctrl-shift-w": "workspace::ActivatePreviousPane",
"ctrl-w v": "pane::SplitLeft",
"ctrl-w ctrl-v": "pane::SplitLeft",
"ctrl-w s": "pane::SplitUp",
"ctrl-w shift-s": "pane::SplitUp",
"ctrl-w ctrl-s": "pane::SplitUp",
"ctrl-w c": "pane::CloseAllItems",
"ctrl-w ctrl-c": "pane::CloseAllItems",
"ctrl-w q": "pane::CloseAllItems",
"ctrl-w ctrl-q": "pane::CloseAllItems",
"ctrl-w o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w ctrl-o": "workspace::CloseInactiveTabsAndPanes",
"ctrl-w n": ["workspace::NewFileInDirection", "Up"],
"ctrl-w ctrl-n": ["workspace::NewFileInDirection", "Up"],
"ctrl-w d": "editor::GoToDefinitionSplit",
"ctrl-w g d": "editor::GoToDefinitionSplit",
"ctrl-w shift-d": "editor::GoToTypeDefinitionSplit",
"ctrl-w g shift-d": "editor::GoToTypeDefinitionSplit",
"ctrl-w space": "editor::OpenExcerptsSplit",
"ctrl-w g space": "editor::OpenExcerptsSplit",
here to find where keys are defined and its makes learning a lot harder

@domi413 domi413 mentioned this issue Jan 9, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discoverability Feedback for discoverability of features, settings, etc enhancement [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc vim
Projects
None yet
Development

No branches or pull requests