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!

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Goliathus
  • 63
  • 1
  • 4
  • 1
    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". – Kent May 01 '13 at 14:34
  • @Kent 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. – Goliathus May 01 '13 at 15:00
  • 1
    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 `.`. – Kent May 01 '13 at 15:19

2 Answers2

14

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

nnoremap . <NOP> 
FDinoff
  • 30,689
  • 5
  • 75
  • 96
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.

sidyll
  • 57,726
  • 14
  • 108
  • 151
  • 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. – Goliathus May 01 '13 at 14:25
  • @Goliathus 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… – sidyll May 01 '13 at 14:31