neovim-lua icon indicating copy to clipboard operation
neovim-lua copied to clipboard

Input delay caused by insert mode <leader> mapping

Open carzum opened this issue 3 years ago • 2 comments
trafficstars

The single insert mode leader key mapping (https://github.com/brainfucksec/neovim-lua/blob/main/nvim/lua/core/keymaps.lua#L51) is causing a noticeable delay before the leader character is rendered. This can be quite annoying, as common leader choices like comma and space are also used often in code. Removing the key mapping speeds up rendering and feels like the 'saner' default mapping.

carzum avatar Sep 06 '22 19:09 carzum

Thanks for reporting, I will do a research on this topic.

brainfucksec avatar Sep 10 '22 14:09 brainfucksec

Its caused by the fast saving keymap, vim will wait 1000ms for the mapped sequence to complete and then render the leader key (:h timeoutlen) https://github.com/brainfucksec/neovim-lua/blob/068e42a6f63645b0c51986a2f173511a62df5616/nvim/lua/core/keymaps.lua#L51

Others might not be bothered by it, this could be considered personal preference ;)

carzum avatar Sep 10 '22 21:09 carzum

@carzum, so the culprit is not the leader key but the mapping with s to save?

brainfucksec avatar Sep 24 '22 04:09 brainfucksec

I removed the key mapping in Insert mode for saving. See: Fix for issue: 22 (Input delay caused by insert mode mapping)

Thanks again @carzum :)

brainfucksec avatar Oct 09 '22 06:10 brainfucksec