-
Notifications
You must be signed in to change notification settings - Fork 189
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
feature: WhichKey command should display keymaps for current mode by default #914
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
I prepared #932 to fix this. I tested locally and seems to work fine. I didn't find any documentation for the |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Bump. The issue is not stale. There is a 1-line PR ready. |
Did you check the docs?
Is your feature request related to a problem? Please describe.
The
:WhichKey
command shows the keymaps for the providedmode
parameter, or for normal mode if none is specified.This means that running the command from other modes (e.g., insert or visual) will not show the proper keymaps and we need to provide the mode explicitly, which is a bit more cumbersome, especially if the
:WhichKey
command is bound to a keymap.Describe the solution you'd like
The
:WhichKey
command should display keymaps for the current mode if the mode parameter is not specified.Proposed fix: change
config.lua, line 313
frommode = "n"
tomode = vim.api.nvim_get_mode().mode
.Describe alternatives you've considered
It's possible to configure mode-specific keymaps that run
:WhichKey
with the appropriate parameter. e.g., instead of:something along the lines of:
I've also thought about using a generic mapping similar to:
However, that doesn't work because entering a command from different modes requires different prefixes (
:
from normal,<C-o>
from insert, need to remove the range prefix in visual mode, etc.).These solutions are unnecessarily complex.
Additional context
No response
The text was updated successfully, but these errors were encountered: