0

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.

Gilney
  • 381
  • 1
  • 4
  • 15
  • 2
    How often do you use Capslock? Because I never do. – Cat Plus Plus Jun 06 '12 at 14:45
  • @Gilney, You are the only one who can answer this question. – romainl Jun 06 '12 at 14:46
  • @CatPlusPlus: I often use the capslock key ... everytime I accidentally hit the key, I use it again to turn it off. Which actually might be a reason not to use it as the "Esc" for Vim if the OP hits that button accidentally as often as I do. – Mark Wilkins Jun 06 '12 at 14:49
  • @CatPlusPlus - I use it regularly for the purpose it was indended for. Every time I need to hold shift for more than two or three letters, caps lock goes on. – Rook Jun 06 '12 at 15:23
  • Remap `` in Vim? Some people use `jj` or similar. As far as caps lock goes, I'm not sure what are you asking. What would be better to map it to? No one can really answer that, apart from offer their opinion on what suits them best. – Rook Jun 06 '12 at 15:23
  • @Idigas - About your first comment, I do exactly same. More then three letters, capslock on. About your second comment, please follow the link added to the question. – Gilney Jun 06 '12 at 17:17
  • @Idigas, it would have to be a sequence of caps with more than two of 'q', 'a', or 'z', since these are the letters the finger holding down shift would otherwise be used for. And even then, the advantage is dubious, since you can use right shift instead. That said, typing this message took more time than caps lock could possibly have saved me in years to come. – Don Reba Jun 06 '12 at 17:19
  • @Cat-Plus-Plus, may you share your technique to never need it? Although I use it not so often, I can't imagine an alternative. – Gilney Jun 06 '12 at 17:21
  • 1
    @Gilney: I rarely have to write more than few letters in uppercase. And I find holding Shift is less disruptive than remembering to switch CL on and then off again. – Cat Plus Plus Jun 06 '12 at 17:26
  • @MarkWilkins You definitely should consider making it LControl then. Accidentally hitting control key is ignored by almost all programs (I can’t remember any program that does not ignore a single LControl and is not a game). – ZyX Jun 07 '12 at 20:00
  • @CatPlusPlus - Yes, but why do you automatically assume that other people feel so too? People have different usages and caps lock was put there for a purpose. – Rook Jun 07 '12 at 21:17
  • @ldigas: ScrollLock was put there on purpose, too. I don't find it particularly useful, either. CL causes more problems than it solves. – Cat Plus Plus Jun 07 '12 at 21:49
  • @CatPlusPlus - I find scrolllock very useful, in several applications. What problems CL causes for you? – Rook Jun 07 '12 at 23:16

3 Answers3

4

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}
TimK
  • 4,635
  • 2
  • 27
  • 27
  • I added the mappings to the answer. – TimK May 13 '14 at 20:29
  • Thanks, it was the shift capslock part that I wasn't clear about. Note for just mapping capslock to escape I have used: `CapsLock::Esc` and it works. See http://www.autohotkey.com/docs/misc/Remap.htm Not sure what the implications of doing it that way are vs using `Send` – User May 13 '14 at 20:33
1

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).
ZyX
  • 52,536
  • 7
  • 114
  • 135
0

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.

weronika
  • 2,561
  • 2
  • 24
  • 30