News for hackers. Stuff that matters.
Re:The cleanest vimrc you'll ever see by jdludlow on Friday January 20, 2012 @01:52PM (#3490655)
Remap caps-lock to escape

Ugh, why? Remapping caps-lock to Ctrl makes more sense to me. The Escape key is still in the upper-left, and banging somewhere in that vicinity usually hits it. Also Ctrl-C equals Escape in vim, so you still have quick access to it from the home row if you want.

Re:The cleanest vimrc you'll ever see by stevelosh on Friday January 20, 2012 @01:55PM (#3490683)
I remapped Capslock to:

"Ctrl if it's held down and pressed with another key, Escape if it's pressed and released on its own."

It works really nicely once you get used to it.

EDIT:

To do that I first mapped Capslock to Ctrl using the normal Apple Keyboard prefs, then used KeyRemap4MacBook and checked this setting: http://i.imgur.com/99cNs.png

http://pqrs.org/macosx/keyremap4macbook/

Re:The cleanest vimrc you'll ever see by jdludlow on Friday January 20, 2012 @01:58PM (#3490700)
I could definitely get used to that. Did you remap that in vim itself, or from your operating system?
Re:The cleanest vimrc you'll ever see by zmanji on Friday January 20, 2012 @02:13PM (#3490766)
How did you get your operating system to do that?
Re:The cleanest vimrc you'll ever see by kmm on Friday January 20, 2012 @02:37PM (#3490868)
I remapped Caps Lock to Escape too and it interestingly one of the best hacks I ever did. On my keyboard at least, Esc is far away from the home row, and the smallest button on my keyboard (1x1.6 cm^2). Caps Lock is the fourth largest button (1.8x3.2 cm^2) and is only a small distance to the left. I can easily reach Ctrl with my pinky, but not Esc.

It's also useful outside of Vim, in almost any application Esc means "Cancel the current operation". The only disadvantage I see is that I'm constantly toggling Caps Lock on other PC's.

Re:The cleanest vimrc you'll ever see by mgrouchy on Friday January 20, 2012 @03:11PM (#3491019)
I have "jj" mapped to esc, caps-lock remapped to Ctrl.

jj only an issue if you are tying things like jj.Reddick or jj abrams :)

Re:The cleanest vimrc you'll ever see by skwp on Saturday January 21, 2012 @03:50AM (#3493043)
The reason is capslock is on the home row, and control is not. I use a Kinesis Advantage keyboard, so ctrl is also in a good spot (thumb), but for most people, less stress would be to use the homerow key rather than bend their pinky to hit ctrl. It's a minor thing but it adds up.

If you use escape with vim you're actually "doing it wrong" in the sense that vim was not designed for your keyboard. On older keyboards escape was where the Tab key is now. There's no reason to abuse your wrists with repetitive motions going up to the escape key.

Re:The cleanest vimrc you'll ever see by burgerbrain on Friday January 20, 2012 @05:47PM (#3491570)
Eh. I already have two ctrl keys, and use escape far more often then either of them. Ctrl-z is the only common thing I do with control, and I don't need that to be easily done from the home row.
Re:The cleanest vimrc you'll ever see by klaruz on Friday January 20, 2012 @04:04PM (#3491215)
Ctrl-[ is escape, so if your caps lock is a control key you only need to move your pinkies a tiny amount to hit escape.
Re:The cleanest vimrc you'll ever see by csexton on Friday January 20, 2012 @05:16PM (#3491469)
This. And it works most places in the terminal.
Re:The cleanest vimrc you'll ever see by cpeterso on Friday January 20, 2012 @03:52PM (#3491173)
I remapped space to colon (so I can enter commands without shifting for colon). :)
Re:The cleanest vimrc you'll ever see by weaksauce on Friday January 20, 2012 @05:06PM (#3491428)
well nnoremap ; : is a good way to do that and keep space open for other things unless you use ; for something more useful.
Re:The cleanest vimrc you'll ever see by r00k on Friday January 20, 2012 @05:12PM (#3491450)
I'd recommend not mapping over ; It's very useful. It repeats your last f or F command. I probably use it a dozen times a day.

If you do map something on top of it, consider moving it elsewhere.

Re:The cleanest vimrc you'll ever see by weaksauce on Friday January 20, 2012 @08:57PM (#3492256)
That's actually quite useful... I was working off a modified vimrc that had this remap on it and got used to it. Maybe leader f to redo? Though I haven't checked if that is taken by something else. Thanks for the tip.