-
Notifications
You must be signed in to change notification settings - Fork 43.3k
Fix which-key delay settings #1276
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
Conversation
|
|
||
| -- Decrease mapped sequence wait time | ||
| -- Displays which-key popup sooner | ||
| vim.opt.timeoutlen = 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this in. Removing this increases the timeoutlen to the default 1000 ms for all other map sequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
| 'folke/which-key.nvim', | ||
| event = 'VimEnter', -- Sets the loading event to 'VimEnter' | ||
| opts = { | ||
| delay = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment here explaining delay option and that it is independent of the timeoutlen option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
fb4e3d0 to
a827c80
Compare
The which-key plugin used to rely on vim.opt.timeoutlen, but it was updated a few months ago to use its own opt.delay instead. https://github.com/folke/which-key.nvim/blob/8ab96b38a2530eacba5be717f52e04601eb59326/NEWS.md?plain=1#L10 I set which-key's delay to 0 ms because it makes it feel snappy and responsive! That way, we give new users a good first impression.
a827c80 to
70b0566
Compare
iton0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Hey @iton0 thank you SO MUCH for helping polish this change and for all your contributions in general. @jensenr30 thanks for this fix! Much appreciated. |
I was trying to make which-key pop up instantly. I tried changing
vim.opt.timeoutlento 0, then to 1000, but it made no difference. While searching through thewhich-keyrepository, I discovered they changed how the plugin's delay is configured. They used to rely onvim.opt.timeoutlen, but they changed that a few months ago. Now they use their ownopt.delayinstead.The previous 300 ms delay led me assume there was some horribly inefficient code somewhere in neovim, lua, or which-key. I changed the delay to 0 ms and that makes
which-keyfeel really snappy and responsive! I think other newcomers to neovim would appreciate that feel.