Live data from Hacker News

Here is why vim uses the hjkl keys as arrow keys

catonmat.net

91–100 of 100 posts

Re: Here is why vim uses the hjkl keys as arrow keys

#91

Earlier quoted context omitted.

That's a brilliant layout. Unfortunately it appears to require a "tall enter" keyboard rather than the much more common "wide enter". I'm in the market for a nice cherry blue keyboard, so I'll see if I can find one with a tall enter. Anybody have any sources?

It works for horizontal enter as well.. the only key that is missing from a horizontal-enter keyboard is the one between left shift and z, which is just backspace, so you can disregard it. It's just that with a horizontal enter key, the ; key is above the enter. With a boot-shaped enter key the ; is next to l, which makes it easier for me to hit it. I use the command line a lot. If you're looking for a good place tha…

Oh yes, you're right -- the only difference is the swap between semicolon and enter. Good for Ruby, bad for C.

The only problem with your layout that I see is the right shift key -- you lose a key because it's covered by two fingers. I'm definitely going to give it a try.

Re: Here is why vim uses the hjkl keys as arrow keys

#92

Earlier quoted context omitted.

It works for horizontal enter as well.. the only key that is missing from a horizontal-enter keyboard is the one between left shift and z, which is just backspace, so you can disregard it. It's just that with a horizontal enter key, the ; key is above the enter. With a boot-shaped enter key the ; is next to l, which makes it easier for me to hit it. I use the command line a lot. If you're looking for a good place tha…

Oh yes, you're right -- the only difference is the swap between semicolon and enter. Good for Ruby, bad for C. The only problem with your layout that I see is the right shift key -- you lose a key because it's covered by two fingers. I'm definitely going to give it a try.

The right shift key is covered only by the pinky finger of your right hand. The ring finger has the forward slash. If you give it a try make sure to send your comments over via bitbucket or something :)

Re: Here is why vim uses the hjkl keys as arrow keys

#93

Earlier quoted context omitted.

This is correct, and the reason they used those keys was that it was the 'home row' on a typewriter which was used in teletypes which meant your little finger could push 'ctrl' and your right hand could drive the cursor through forms without moving off the home row. When I saw the title I was expecting to see a picture of the rogue screen. Rogue (and later hack, and nethack) is a text displayed dungeon exploration ga…

Count me in the school of thought that the control key is meant to be to the left of the A key, just like the horn button is meant to be in the center of a car steering wheel. Every computer keyboard I worked with before the advent of IBM PCs had this arrangement. Every computer I work with now I reconfigure to swap the caps lock with the control key. IT IS THE NATURAL ORDER OF THINGS.

It's a major frustration for me, too, as an Emacs user.

I'm still looking for a hardware dongle that does nothing but map the caps lock scan code to left ctrl. Sure, I can rebind the key (and I do) but as a contractor I move around a lot and having something that circumvents the OS entirely would come in handy.

Re: Here is why vim uses the hjkl keys as arrow keys

#95
post #93

Earlier quoted context omitted.

Count me in the school of thought that the control key is meant to be to the left of the A key, just like the horn button is meant to be in the center of a car steering wheel. Every computer keyboard I worked with before the advent of IBM PCs had this arrangement. Every computer I work with now I reconfigure to swap the caps lock with the control key. IT IS THE NATURAL ORDER OF THINGS.

It's a major frustration for me, too, as an Emacs user. I'm still looking for a hardware dongle that does nothing but map the caps lock scan code to left ctrl. Sure, I can rebind the key (and I do) but as a contractor I move around a lot and having something that circumvents the OS entirely would come in handy.

I use a keyboard that has a similar layout to that in the images above (ctrl to left of A, tilde on home key at top right etc). It's called the Happy Hacking Keyboard and is made in Japan by a Fujitsu subsidiary: see here http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard. It's extremely expensive (~$300 or so) but has amazing key action and having gotten used to it I would never want to use anything else

Re: Here is why vim uses the hjkl keys as arrow keys

#96
post #2

Oh lord! I remember these unibody terminals. I had to use the Volker-Craig VC4404 . That thing was built like a tank. You had to hammer at the keys with great force. Soon one got into the habit of hammering on the keys all the time. And then one day I walked into the lab with shiny new VT-100 terminals with their soft keys; but started hammering on them by habit. And everybody turned around and looked at me as if I w…

Here's a VC4404 manual which shows the key layout/functions:

http://vt100.net/volker-craig/vc4404-um.pdf

Re: Here is why vim uses the hjkl keys as arrow keys

#97

Doesn't this go way back though? 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. The effect was that H which is ASCII 0x48 would become 0x08 which is backspace. If you look at an ASCII table (e.g. http://www.asciitable.com/ ) you will notice how the uppercase ASCII le…

Actually, on a Teletype, VT went down, not up. (Vertical tab stops were settable only in hardware on most models.) And FF, which went to the top of the next page, is obviously unrelated to going right. So the correspondence was really just suggested by BS and LF; it was apparently some terminal manufacturer's idea to put up and right on the next two keys.

As far as I know, this was Lear Siegler's invention; I don't know of any other terminals from the era that use ^K and ^L for "move up" and "move right". (Someone did mention that ^K and ^L did do that on the ADM-3A, right?)

Re: Here is why vim uses the hjkl keys as arrow keys

#98

ADM3a was a terminal, not a computer. I used to use these two in around 1976 or so. And the hjkl pattern has nothing to do with this or any other terminal. The ASCII control codes for Ctrl-H, Ctrl-J, Ctrl-K and Ctrl-L were used to make the Teletype's printing carriage move left, down, up or right. Bill Joy's innovation was "modes" so that Ctrl-H did not delete the character when it moved left, etc...

Bill Joy didn't invent modes; all editors were very modeful until Bravo, in the 1970s. And in vi, you don't use ^H to move left; you use h. Tony has already corrected you on ^K and ^L, but I'll point out that there was a way to move the carriage right on a Teletype, even though it wasn't ^L: the SPACE character does that.

Re: Here is why vim uses the hjkl keys as arrow keys

#99
post #11

Earlier quoted context omitted.

Probably because it didn't have dedicated arrow keys. Many older terminal keyboards didn't.

And the reason they didn't was that they evolved from typewriters that relied on a forward/backward spin to move up and down (except for the carriage return lever). We're lucky that the original terminals didn't have a scroll knob on the left and right of the machine to move up and down and a lever to move to the next line or we would have been stuck with that concept for years and the laptop may not have been invent…

I used a scroll knob to move up and down (and left and right) on my Blackberry in 2000, and it was awesome. It's dramatically better than using arrow keys. It's a real shame the original CRT terminals didn't have scroll knobs. It would have dramatically improved the usability of computers throughout the 1970s and 80s.

Re: Here is why vim uses the hjkl keys as arrow keys

#100
post #5

The ADM-3A was a dumb terminal (well, it had to have had some level of screen addressibility, but was definitely not ANSI-compatible), not a computer. They were sold as kits, and about 1/3 the price of a VT-100. I remember reading somewhere that they were the first glass teletypes available to the BSD folks, and Bill Joy wrote vi purely because it allowed him to monopolize one for his own use.

Yes, in addition to the cursor movement control characters, there was a single escape sequence for moving to a specified row and column. I didn't know they were sold as kits. Did you buy a kit?
Post reply on HN