4

When I define key mappings, I prefer using a modifier key with another key, because modifier key can make you so much fast if you need to press some key mapping multiple times, you only need to hold down the modifier key once and keep pressing the other key.

e.g.
say if I map ctrl j to cycle through opening windows. I just need to hold down ctrl once and press several time j to get to the window I want. that's just 1 * ctrl + n * j key strokes.

But the <leader> key is different. <leader> key is not modifier key. So if map <leader> j to cycle through windows. I need to repeat: press <leader>, press j several times. that's n * <leader> + n * j key strokes.

So is there any chance I can make the <leader> key modifier? or if you know some other way I can define my own modifier key?

  • 1
    Why don't you just use <ctrl>- mappings directly, if that is what you want? – Karl Yngve Lervåg Dec 18 '15 at 7:33
  • because I don't want to override some built-in key mappings. – Aaron Shen Dec 18 '15 at 22:32
6

As has been said, this is not directly possible. There exists however plugins that create clever maps to achieve something similar: tinykeymap, tinymode or vim-submode

  • Thanks for the plugins, they seem very interesting. I'll give a try. – Aaron Shen Dec 18 '15 at 22:33
4

You can't turn the <leader> key into a modifier key and you can't create your own modifier keys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.