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
4.75k stars 154 forks source link

feature: Configuration option to override the usage of timeoutlen #549

Closed s1n7ax closed 2 hours ago

s1n7ax commented 7 months ago

Did you check the docs?

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

timeoutlen really doesn't defines the purpose of the property clearly in neovim. So when multiple plugins are using the same global value to do two separate things, there is no option except to find the middle ground for both.

Ex:- Oil.nvim uses timeoutlen to delay the update of effects like toggle hidden files/directories. Which-key is using timeoutlen to delay the popup window.

If what the user wants is to show the oil.nvim to act immediately at the same time which-key to delay the window by 1000ms, then this is not possible.

Describe the solution you'd like

Accept timeout option from the configuration. Fallback to timeoutlen if it's not available or set a default timeout value.

timeout = timeout or vim.o.timeoutlen

OR

timeout = timeout or 500

Describe alternatives you've considered

I think the timeoutlen is a global option so I could not find a solution other than set it to 1000 and hope I don't have to toggle hidden as much in oil.nvim.

Additional context

-

github-actions[bot] commented 6 days 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.