folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.12k stars 163 forks source link

feature: Programmetically get current pending keymap #788

Closed thunder-coding closed 1 week ago

thunder-coding commented 1 month ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

When which-key is installed, Neovim's statusline's '%S' option doesn't display the current keys being pressed. Although which-key window also has a current key pressed as title, but the position of the title is not fixed (atleast when using the "helix" preset). Having current key press at a constant position is desirable for me.

Describe the solution you'd like

A function in which-key, something like require('which-key').current_key() which would give the current key combination which is pending to be executed. In case when there is no pending keys, it could simply return an empty string or nil

Describe alternatives you've considered

noice's require("noice").api.status.command.get, but it doesn't seem to work when which-key is also present. Also noice seems to only return something once the command is completed. Apart from that another alternative is screenkey.nvim, but it doesn't just show the current command

Additional context

No response

github-actions[bot] commented 2 weeks ago

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.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stalled for 7 days with no activity.