3 ms·
The only thing preventing me from using <space> is the slight lag it introduce each time <space> is used in insert mode. It is bearable with ',', but I cannot
by grive 9y ago
The only thing preventing me from using <space> is the slight lag it introduce each time <space> is used in insert mode.
It is bearable with ',', but I cannot stand it with <space>.
If it is possible to remove completely this lag (not simply reduce it), then it would be awesome.
- lucidstack 9y agoApologies if this is incorrect (on my phone atm) but I've been using <space> as leader for two years now, and have never ever noticed lag in insert mode. Perhaps it's a setting you have enabled/disabled, or unrelated to vim?
- grive 9y agoThis lag is introduced by vim, to wait for the next keys and see if you are actually inserting them or using mapped key sequence. It is configurable in vim, but then either you have a lag and you are able to use your key sequence, or you don't and <leader> sequences cannot be used. So maybe I have something configured that sets it wrong, but I do not see how to reconcile both things.
- robenkleene 9y agoUnless you’re deliberately enabling certain key mappings in insert mode, then yes you’ve configured something wrong. And if you have deliberately enabled these bindings, you’re probably misunderstanding Vim. The whole point of Vim’s normal mode is to free up “modifier-free” key mappings for commands rather than inserting characters. So by extension, using “modifier-free” key mappings for commands in insert mode is a Vim anti-pattern (if you want custom mapping’s in insert mode, use mappings for them with modifier keys). Regarding your issue, I suspect your defining your bindings with the `map` keyword when you should be using `nmap` (or better yet `nnoremap‘).
- Sean1708 9y agoPresumably you don't have any <leader> key mappings that are active in insert mode?
- lbebber 9y agoDo you need to use it on insert mode as well? I set to use space as the leader key only on normal mode so there's no lag.
- Graziano_M 9y agoThe problem is not the leader itself, but instead the bindings you're setting using leader: Use nmap instead of imap so that the mappings aren't even checked during insert mode.