News for hackers. Stuff that matters.
Re:Vim after 15 Years by rav on Thursday October 19, 2017 @02:11AM (#15505784)
I would not remap , and ; as the article suggests, since those keys are already used in Vim for repeating f/F/t/T.
Re:Vim after 15 Years by Graziano_M on Thursday October 19, 2017 @02:36AM (#15505880)
I have not heard any good argument for a leader key better than <space>. <space>f, t, b for fzf (and t is not a stretch on my keyboard layout)
Re:Vim after 15 Years by grive on Thursday October 19, 2017 @04:54AM (#15506440)
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.

Re:Vim after 15 Years by lbebber on Thursday October 19, 2017 @09:38AM (#15507735)
Do 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.
Re:Vim after 15 Years by lucidstack on Thursday October 19, 2017 @08:54AM (#15507438)
Apologies 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?

Re:Vim after 15 Years by Sean1708 on Thursday October 19, 2017 @09:25AM (#15507632)
Presumably you don't have any <leader> key mappings that are active in insert mode?
Re:Vim after 15 Years by grive on Thursday October 19, 2017 @09:13AM (#15507556)
This 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.

Re:Vim after 15 Years by robenkleene on Friday October 20, 2017 @08:32AM (#15515220)
Unless 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‘).

Re:Vim after 15 Years by Graziano_M on Saturday October 21, 2017 @02:56AM (#15520975)
The 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.
Re:Vim after 15 Years by PurpleRamen on Thursday October 19, 2017 @06:40AM (#15506805)
You can't use space as leader in insert-mode?
Re:Vim after 15 Years by s_kilk on Thursday October 19, 2017 @04:24AM (#15506306)
> (and t is not a stretch on my keyboard layout)

Colemak?

Re:Vim after 15 Years by Walf on Thursday October 19, 2017 @09:38AM (#15507730)
t? How does that not ruin "to" movements?
Re:Vim after 15 Years by Graziano_M on Saturday October 21, 2017 @02:51AM (#15520959)
It's hit after leader. `t` on its own is still `to`.
Re:Vim after 15 Years by s_kilk on Friday October 20, 2017 @05:21AM (#15514514)
Why would it? In the Colemak layout, 't' is on the left-hand index finger, it couldn't be more convenient.
Re:Vim after 15 Years by Graziano_M on Saturday October 21, 2017 @02:50AM (#15520958)
bingo
Re:Vim after 15 Years by blymphony on Thursday October 19, 2017 @09:51AM (#15507850)
I wrote a plugin [1] that highlights the first occurrences of characters from your cursor, to make f/F/t/T/;/, easier to use.

[1] https://github.com/unblevable/quick-scope

Re:Vim after 15 Years by bananicorn on Thursday October 19, 2017 @04:50AM (#15506425)
I remapped , to ; and vice-versa - comma repeating the search in its actual direction and semicolon repeating it in the reverse direction just makes more sense on a german keyboard.

But yes, these keys' intended functions are actually really damn handy, and I use them on a daily basis.