News for hackers. Stuff that matters.
Re:Staying the hell out of insert mode (vi) by oliverkofoed on Monday April 26, 2010 @04:24PM (#1295880)
The author recommends remapping "kj" to ESC.

I've remapped caps lock to ESC, which I think is a far better use of that useless button, and a hack i recommend to everybody i know who uses VIM.

I could never understand that VIM choose to put such an important button so far away from the homerow.

Re:Staying the hell out of insert mode (vi) by silentbicycle on Monday April 26, 2010 @04:32PM (#1295905)
Escape used to be located closer, IIRC it was next to 1 (on `) on some older keyboards. (Much like Ctrl used to be where CapsLocks is now.)

Moving it is easy, of course. Also, Ctrl-[ is usually the same key as Escape, and if you have CapsLock remapped to Ctrl, they're practically on the home row. (The article hints at this, but doesn't explicitly note that C-[ is Esc.) You could also remap CapsLock to Esc, of course.

Re:Staying the hell out of insert mode (vi) by oliverkofoed on Monday April 26, 2010 @06:06PM (#1296339)
I'm on a danish keyboard; the programmer-handy keys like "[" and "]" have been moved to shortcuts (alt-9 for "]") to make room for the danish letters "æøå", so some of the combo's that are easy to make on english keyboards are next to impossible on mine.

Once in an effort to reach maximum typing efficiency, i attempted a switch to VIM+Dvorak. However, i quickly realized that i would have to use a Danish variant of Dvorak (there is no official standard..) and remap VIM to oblivion, which would make me too much of an oddball masochist.

Re:Staying the hell out of insert mode (vi) by silentbicycle on Monday April 26, 2010 @09:21PM (#1296825)
A bunch of my coworkers are Swedish, and I've had similar issues with the brackets. It's aggravating.

I use the English/American Dvorak, but it takes me a second to switch back to qwerty as necessary. (I'm probably in the rare niche of mixed vi/emacs users, FWIW.) Vi + Dvorak isn't so bad, though I feel like Dvorak is (somehow) more compatible with Emacs.

Re:Staying the hell out of insert mode (vi) by slug on Monday April 26, 2010 @10:45PM (#1297033)
I have the same problem, although for a different language, and solved it by using a shortcut (alt-ctrl-k) to switch between layouts (en-us,etc). I do it both on KDE and fluxbox, which are fairly easy to configure and the "mental" switch is not problematic.
Re:Staying the hell out of insert mode (vi) by rix0r on Tuesday April 27, 2010 @03:04AM (#1297471)
This is what keeps me off switching to Dvorak: I have all these keyboard shortcuts wired into my muscle memory that I would have to either relearn or remap when switching to Dvorak that it's just too much of a bother...
Re:Staying the hell out of insert mode (vi) by eelco on Tuesday April 27, 2010 @05:49AM (#1297717)
If you're on OS X you can ease into it by using the 'Dvorak except for shortcuts' keyboard mode.
Re:Staying the hell out of insert mode (vi) by chancho on Monday April 26, 2010 @10:03PM (#1296917)
The happy hacking keyboard has both the esc and ctrl keys in these (proper) positions. Highly recommended for vimming.

http://www.engadget.com/2007/01/26/happy-hacking-keyboard-li...

Re:Staying the hell out of insert mode (vi) by silentbicycle on Monday April 26, 2010 @10:11PM (#1296940)
Yeah, but re-mapping is easy. Personally, I'm fond of the (gasp!) Microsoft 4000 Natural Keyboard, with several remappings.
Re:Staying the hell out of insert mode (vi) by hoprocker on Tuesday April 27, 2010 @12:15AM (#1297185)
A-men. Plus, OS X makes swapping caps<->ctrl super easy, so do that on a MS4000 and you're two large steps nearer to healthier longer-lasting wrists.
Re:Staying the hell out of insert mode (vi) by jff on Tuesday April 27, 2010 @02:11AM (#1297381)
vi was developed on the ADM-3A terminal, which indeed has the ESC key in the space occupied by ` these days. It also had Control in the proper place, but the arrangements of some of the punctuation keys on the right side of the keyboard always seemed rather hosed to me.
Re:Staying the hell out of insert mode (vi) by xutopia on Monday April 26, 2010 @05:04PM (#1296058)
In the same vein it seems totally ridiculous that we use the pinky finger to hit ctrl. Surely there are better ways.
Re:Staying the hell out of insert mode (vi) by spudlyo on Monday April 26, 2010 @06:28PM (#1296406)
There are. The Kinesis keyboard has four thumb buttons on each side of the keyboard. The biggest, closest one on the left side I map to CONTROL. The other big left thumb button I map to ESCAPE.
Re:Staying the hell out of insert mode (vi) by RevRal on Monday April 26, 2010 @06:45PM (#1296474)
You can also look into importing a Japanese keyboard for more thumb options.
Re:Staying the hell out of insert mode (vi) by Calamitous on Tuesday April 27, 2010 @02:21AM (#1297402)
Why? Do the Japanese have more thumbs?

Sorry. Had to get it out my system.

Re:Staying the hell out of insert mode (vi) by RevRal on Tuesday April 27, 2010 @04:50AM (#1297631)
I don't get it. . . .

They have two thumbs, but within reach of their thumbs are extra keys. They need these extra keys because there are a lot of characters in their writing. They don't need more thumbs, because they only need to push one of these extra keys at a time.

Do I need more pointer fingers if I need to use one of the Y, H, N, B, T, G, and V keys?

Re:Staying the hell out of insert mode (vi) by Calamitous on Thursday April 29, 2010 @01:17PM (#1305176)
Um, it was a joke...
Re:Staying the hell out of insert mode (vi) by Hexstream on Monday April 26, 2010 @10:31PM (#1297001)
I remapped my keyboard so I can press CTRL with my thumb (it's where ALT conventionnaly is). No need to use pinkies and alternate between left and right CTRL!
Re:Staying the hell out of insert mode (vi) by goof on Monday April 26, 2010 @08:58PM (#1296793)
I map right alt to ctrl. This gives you alt with your left thumb and ctrl with your right thumb, which is pretty intuitive once you get used to it.
Re:Staying the hell out of insert mode (vi) by breck on Monday April 26, 2010 @10:10PM (#1296936)
i map capslock to ctrl using autohotkey
Re:Staying the hell out of insert mode (vi) by WildUtah on Monday April 26, 2010 @09:36PM (#1296848)
I've remapped caps lock to ESC

I find that Mac keyboards are very difficult to remap. Is there any reason for that? Or maybe there's some utility that handles remapping I just can't find. Buggy as it is, I miss xmodmap.

Re:Staying the hell out of insert mode (vi) by banjiewen on Monday April 26, 2010 @10:07PM (#1296927)
If you're just remapping modifier keys, the Keyboard prefs pane works well (not sure if it's part of Leopard, though).

If you want to map something to ESC, try PCKeyboardHack: http://pqrs.org/macosx/keyremap4macbook/extra.html

Re:Staying the hell out of insert mode (vi) by cloudhead on Monday April 26, 2010 @10:15PM (#1296951)
You can remap the modifier keys (Caps Lock, Alt, Cmd) from the preferences pannel, in Keyboard. There's a button at the bottom, called "Modifier Keys..."
Re:Staying the hell out of insert mode (vi) by idoh on Tuesday April 27, 2010 @12:50AM (#1297240)
This is true but that utility won't let you remap Caps to Esc.
Re:Staying the hell out of insert mode (vi) by chancho on Monday April 26, 2010 @10:21PM (#1296964)
Very good Mac keyboard remapper: http://scripts.sil.org/ukelele