brainfucksec / neovim-lua

Neovim KISS configuration with Lua
GNU General Public License v3.0
822 stars 115 forks source link

Input delay caused by insert mode <leader> mapping #22

Closed carzum closed 2 years ago

carzum commented 2 years ago

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.

brainfucksec commented 2 years ago

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

carzum commented 2 years ago

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 ;)

brainfucksec commented 2 years ago

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

brainfucksec commented 2 years ago

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 :)