which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

feature: Use `ModeChanged` autocmd to show the hints for operator-pending and visual mode

Open IndianBoy42 opened this issue 2 years ago • 2 comments

Did you check the docs?

  • [X] I have read all the which-key.nvim docs

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

Currently for operators to have the which-key window show up requires them to be bound to a which-key specific mapping. This requires the user to be careful about setup order and remember to add the operator to the which-key setup (and change it if they every change the mapping. This isn't very flexible.

Describe the solution you'd like

I was thinking about it I wondered if instead of triggering the which-key menu from a keybinding, the ModeChanged autocmd could be used, perhaps along with a vim.on_key listener

Describe alternatives you've considered

Keep it as is

Additional context

No response

IndianBoy42 avatar Jun 25 '23 16:06 IndianBoy42

That's actually a really great idea. ModeChanged together with vim.v.operator should probably work indeed!

folke avatar Jun 25 '23 17:06 folke

I'd really like to see this as I have a few keymaps and plugins that register as a new operator, so having the same thing for them as y and d would be really helpful.

Red-M avatar Feb 14 '24 09:02 Red-M

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] avatar Jul 06 '24 01:07 github-actions[bot]

I've finally got some time to do a big rewrite of which-key and it indeed now uses ModeChanged :)

folke avatar Jul 11 '24 17:07 folke