-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
Fix which-key delay settings #1276
base: master
Are you sure you want to change the base?
Conversation
@@ -134,10 +134,6 @@ vim.opt.signcolumn = 'yes' | |||
-- Decrease update time | |||
vim.opt.updatetime = 250 | |||
|
|||
-- 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.
@@ -274,6 +270,7 @@ require('lazy').setup({ | |||
'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
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
I was trying to make which-key pop up instantly. I tried changing
vim.opt.timeoutlen
to 0, then to 1000, but it made no difference. While searching through thewhich-key
repository, 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.delay
instead.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-key
feel really snappy and responsive! I think other newcomers to neovim would appreciate that feel.