Linked by Thom Holwerda on Fri 9th Mar 2012 19:11 UTC
General Development "I was reading about vim the other day and found out why it used hjkl keys as arrow keys. When Bill Joy created the vi text editor he used the ADM-3A terminal, which had the arrows on hjkl keys, so naturally he reused the same keys." As interesting as that is, John Graham-Cumming goes even further back in history. "The reason that keyboard had those arrows keys on it was because those keys correspond to CTRL-H, J, K, L and the CTRL key back then worked by killing bit 6 (and bit 5) of the characters being typed." Truly fascinating stuff, even though it's from way before my time (I'm from 1984).
Thread beginning with comment 510129
To read all comments associated with this story, please click here.
...
by Hiev on Fri 9th Mar 2012 20:12 UTC
Hiev
Member since:
2005-09-27

So Vim is an example of out dated hardware model enforced in the new one? Good job.

Reply Score: -1

RE: ...
by righard on Fri 9th Mar 2012 20:35 in reply to "..."
righard Member since:
2007-12-26

You can still use the arrow keys if you like.

Reply Parent Score: 6

RE[2]: ...
by Bishi on Fri 9th Mar 2012 21:48 in reply to "RE: ..."
Bishi Member since:
2009-08-27

Yet they behave differently. One remembers cursor location when moving between lines, the other one does not.

Reply Parent Score: 1

RE[2]: ...
by orestes on Sat 10th Mar 2012 04:27 in reply to "RE: ..."
orestes Member since:
2005-07-06

Of course if you do, you'll have to move your hand off home row and slow yourself down considerably. =)

Reply Parent Score: 1

RE: ...
by DOSguy on Sat 10th Mar 2012 01:21 in reply to "..."
DOSguy Member since:
2009-07-27

So Vim is an example of out dated hardware model enforced in the new one? Good job.


So what are you saying? Using hjkl worked fine in those days, but now that we have dedicated arrow keys it doesn't work anymore?

Byt the way, Vim doesn't enforce it; if you would like the arrow keys, you can... One could only argue that is not the vi way to navigate, though.

Reply Parent Score: 2

RE: ...
by Doc Pain on Sat 10th Mar 2012 02:09 in reply to "..."
Doc Pain Member since:
2006-10-08

So Vim is an example of out dated hardware model enforced in the new one? Good job.


So "Windows" and most of today's programs are also an example of something outdated enforced on the users?

Remember:

Ctrl-Z = undo
Ctrl-X = cut
Ctrl-C = copy
Ctrl-V = paste

See where Z, X, C and V are located on your keyboard (or refer to the US keyboard layout if needed). Looks obvious? You can do some research (simple web search should be sufficient) why this is, and why it still exists today.

To come back why it's actually a good thing to have something "outdated" in vim (and in vi, too): Imagine you have to connect to a UNIX system (or Linux, Solaris, HP-UX or AIX, whatever) that just functions in a minimal state and needs maintenance. The responsible sysadmin has made a mistake and terminal capabilitites don't work at the "high level" you expect, which is required to use the arrow keys. Still you can connect to that system and need to edit a file in the "visual editor" (vi). Whenever you press a cursor key, garbage appears in your terminal session, but the desired cursor movement doesn't happen. But using the HJKL keys will - together with the other "letters only" command keys of vi - to get your job done. In worst case, this is what you want.

But wait, there's more:

Imagine a person with impaired movement of the arm (arm in singular may mean that only one arm is available) or the hand uses a computer. Compare the travelling distance of the fingers from the alphanumeric keyboard section over to the cursor keys. Know that the Escape key is used to switch vi's modes. Now you can easily recognize that having the alternative not to use the cursor keys can be a benefit!

Of course, all those considerations don't apply to mouse-driven users, just as vi doesn't apply to any average person. :-)

Reply Parent Score: 5

RE[2]: ...
by Alfman on Sat 10th Mar 2012 03:14 in reply to "RE: ..."
Alfman Member since:
2011-01-28

Doc Pain,


"Imagine a person with impaired movement of the arm (arm in singular may mean that only one arm is available) or the hand uses a computer. Compare the travelling distance of the fingers from the alphanumeric keyboard section over to the cursor keys. Know that the Escape key is used to switch vi's modes. Now you can easily recognize that having the alternative not to use the cursor keys can be a benefit!"

Personally, I have mixed feelings about VI. I do use it all the time simply because it's available everywhere and that makes it an essential tool. But VI's modes often get in the way of what my brain is thinking and I'd much rather use a stateless interface so my poor escape key can get some rest. To be honest I find ESC to be even less "accessible" than arrow keys are, and while the arrow keys are supported these days, dropping to command mode is still a frequent requirement. Raise your hands, how many people accidentally type or paste text into command mode? I prefer stateless hotkeys because pressing and releasing a modifier has no side effects and I don't have to concentrate on what mode my editor is in (ALT changes focus to menu bar on windows, but CTRL is stateless). I do appreciate the technical limitations under which VI evolved, and I will continue to use it on the console simply out of habit.

Reply Parent Score: 4

RE[2]: ...
by Neolander on Sat 10th Mar 2012 08:14 in reply to "RE: ..."
Neolander Member since:
2010-03-08

Ctrl-Z = undo
Ctrl-X = cut
Ctrl-C = copy
Ctrl-V = paste

See where Z, X, C and V are located on your keyboard (or refer to the US keyboard layout if needed). Looks obvious? You can do some research (simple web search should be sufficient) why this is, and why it still exists today.

Born with an AZERTY keyboard in the hand, I always figured that it was because it makes sense from a usability point of view to have cut, copy, and paste close to each other.

It's true that if you add cancel to the mix, it starts to feel like a software performance hack.

Reply Parent Score: 1

RE[2]: ...
by zima on Fri 16th Mar 2012 23:52 in reply to "RE: ..."
zima Member since:
2005-07-06

But wait, there's more:

Imagine a person with impaired movement of the arm (arm in singular may mean that only one arm is available) or the hand uses a computer. Compare the travelling distance of the fingers from the alphanumeric keyboard section over to the cursor keys. Know that the Escape key is used to switch vi's modes. Now you can easily recognize that having the alternative not to use the cursor keys can be a benefit!

"A minimum for remote access" or... touchtyping are all well and good, but this^ one might be not so simple, & perhaps you should have looked at the keyboard while typing it. :p

HJKL are basically right in the middle between Esc and cursor keys (for somebody who certainly doesn't type that much in the first place, home row resting place has less meaning) ...plus:

a) cursor keys are typically quite conveniently at least as a semi-separate block, most importantly with no keys below them that can be hit accidentally

b) HJKL & Esc require attention to not hit any of the keys around and below, by that malfunctioning hand.

So as to which one's easier ...yeah, I remember well how it worked when I had my broken hand in a plaster - cursor keys were one of the few totally unaffected, usage-wise (modal things were the biggest issue)

Of course, all those considerations don't apply to mouse-driven users, just as vi doesn't apply to any average person. :-)

Though OTOH even vi (and such) users still fall under http://plan9.bell-labs.com/wiki/plan9/Mouse_vs._keyboard/index.html ...their brains aren't that "non-average" (generally, being very invested into this stuff makes some biases of perception easier - remember, they are felt by the very same organ which invested a lot of effort into given skill)

Edited 2012-03-16 23:54 UTC

Reply Parent Score: 2