VIM: unmap period key in normal mode [closed]
Asked Answered
F

2

6

I try to use the EasyMotion plugin, but I don't want to use the normal leader key, which is the \-key in my case. I also don't intend to change the leader key all together, as it might break things in vim-latex.

So I thought about using the period-key for this (I am already using the comma-key for going into command-line mode), because I never really use its repeat feature:

This is what I have tried so far in my .vimrc:

nunmap .
let g:EasyMotion_leader_key = '.'

The second command works just fine as it seems. But I can't unbind the period key with the first command (E31: No such mapping). If I am wrong with only wanting to unbind the period-key in normal mode, then feel free to correct me.

Any ideas are appreciated!

Fraternal answered 1/5, 2013 at 14:12 Comment(3)
I just want to remind, useing . as a lead may not a good idea. in normal mode . does repeat. :h . see detail. you will lose this nice feature if you use . as a "leader".Tomato
@Tomato I haven't really had any use for it. That's why I thought about using it as a leader in this case. If you have any good example on why it is so helpful, then feel free to comment on it.Fraternal
I think it is very useful feature. I used it everyday (without almost). I know this cannot convince you. There are too many examples with . to repeat changes. comment area doesn't support code format very well. So you can try it a little by yourself. also there is a plugin "repeat" to extend the function of ..Tomato
E
14

You can disable the dot from working in normal mode by using

nnoremap . <NOP> 
Embroil answered 1/5, 2013 at 14:18 Comment(1)
Exactly what I needed for unintentional Q presses:)Griffey
N
1

The error says it all. There is no such mapping. nunmap is used to remove user maps, and . is a built-in command, not a map, so you don't really unmap it…

It's a bit unclear, but if it works as the desired leader, then you can just remove the line unmapping .. It's not needed.

Nerveracking answered 1/5, 2013 at 14:15 Comment(2)
Well, it works as far as I can use period as the leader key for EasyMotion. The thing is the following: If I type period once and then the appropriate key in EasyMotion, it works as it should. But if I type the period two times, it behaves like the default way, which is repeating the last command. It just feels somewhat "poor" to me, to have a key that can act in a way that I clearly don't want to. The period-key should only be the leader for EasyMotion and nothing else. I thought it would be possible, as I can, for instance, remap comma to give me a colon in normal mode.Fraternal
@Fraternal Ah, I understand. Well then FDinoff indeed placed the answer you were looking for. If you can't unmap it, map it to nothing! :-) I just can't imagine myself without the . command…Nerveracking

© 2022 - 2024 — McMap. All rights reserved.