redyf / Neve

Neve is a Neovim configuration built with Nixvim, it allows you to use Nix language to manage Neovim plugins/options.
MIT License
152 stars 61 forks source link

BUG: nvim-surround not working with `timoutlen` set #102

Closed mcgilly17 closed 2 months ago

mcgilly17 commented 2 months ago

While messing around today I noticed that nvim-surround wasn't working, however, if I have surround-ui installed it works (as does checking the nmap).

The issue for me was the timeoutlen set in sets.nix.

# Reduce which-key timeout to 10ms
timeoutlen = 10;

When I set this timout to around 100ms it starts to work and infact brings up the which-key menu much much faster.

Let me know what you think, I can raise a PR for any changes you fancy. In my configs (based heavily off yours) i have just gone with 100ms and it seems ok from first glance.

Finally: I switched out nvim-surround for mini.surround and found the same issue. This leads me to believe that any two letter shortcut/command will not work when using the timeoutlen of 10ms. Its a pretty crude assumption so anyone has any ideas what is exactly is going on, I would love to be enlightened.

redyf commented 2 months ago

I cannot thank you enought for this, OMG. That's why surround wasn't working for me, maybe they refactored the plugin to use timeoutlen and I totally missed it. A PR would be great, thank you so much!

mcgilly17 commented 2 months ago

On it!

mcgilly17 commented 2 months ago

Done ^^ will leave you with it 👍

mcgilly17 commented 2 months ago

Just made it into one PR rather than two to hopefully make life easier.