Vim remap: Where does the Capslock go?

676 views Asked by At

Ok, I'm convinced that I need remap Esc in vim. My choice is to use Capslock as common. But my question is: Where does the Capslock functionality go?

  • To Esc place?
  • Don't use at all (use selection+'U' to uppercase)?
  • Any other?

What do you think it's more productive?

Thanks in advance.

3

There are 3 answers

2
TimK On BEST ANSWER

I use AutoHotKey (on Windows) to re-map capslock, mainly because I sometimes hit it accidentally. Then I use shift-capslock to get the normal capslock functionality.

I think it would be weird for capslock to work as capslock in some programs but not others.

AutoHotKey mappings to do this (capslock -> esc, shift-capslock -> capslock):

CapsLock:: Send, {ESC}
+CapsLock:: Send, {Blind}{CAPSLOCK}
0
weronika On

Do you see any reason why you might want to still use the Esc key in vim after the CapsLock key is remapped to Esc functionality? (for instance, other people using vim on your computer). If not, there's no reason not to remap Esc to CapsLock functionality - at least unless you want to use the Esc for something else.

Personally I never use CapsLock anyway, but if you do, then you should probably keep it around somewhere - where depends on which keybindings you use and don't use, so it's hard to make a recommendation.

0
ZyX On

I can say that I find my current solution as the most convenient:

  1. capslock is left control,
  2. left control is escape and
  3. escape is capslock (after some X server update I failed to make it behave this way, thus now escape is no-op as I don’t use it anyway).