goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.92k stars 113 forks source link

Some custom buttons respond slow #10

Closed experiacc closed 3 years ago

experiacc commented 3 years ago

Adding custom buttons to dashboard theme is slow for some keys. So far, I've tried this with keys c and d. Both wait for like 1 second to execute command.

For Example :-

dashboard.button( "c", "open config" , ":e ~/.config/nvim/init.lua"),

But if I replace c with something like s, it executes instantly.

goolord commented 3 years ago

what is the output of

:redir >> ./maps.txt
:map
:redir END

? i suspect you already have combination keybindings that begin with c and d and vim is doing the appropriate thing and waiting timeoutlen

experiacc commented 3 years ago

Ok turns out you were right it was this command specifically

n  cS            <Plug>CSurround
n  cs            <Plug>Csurround

from the plugin vim-surround Anyway I can ignore those keybinds in alpha just like in startify ?

goolord commented 3 years ago

ok, i added the 'nowait' option to the buttons for each theme which should fix this. since it's desirable in some cases to turn this behavior off each theme's button function also has an additional optional keybind {opts} parameter. https://github.com/goolord/alpha-nvim/commit/119832cdf516aa3aea97ebf9bf8d1b0e2c642f23