Why does Vim use `hjkl` for navigation? The usual answer is "it keeps your hands on the home row", while the historical answer is "because Bill Joy developed vi on the ADM-3A, which didn't have arrow keys". But we can push the history further back: why did THE ADM use `hjkl`?
6:58 PM · Nov 11, 2020
10
247
623
If we look at the 1967 ASCII standard, the first 32 characters are the "control set", critical but nonrepresentable characters. So people could use them, early keyboards added a "control" key that made letter keys insert control characters. sltls.org/ASCII
1
1
27
Control keys worked by zeroing out the first two bits of the code. The ASCII code for "H" is 100 1000, so ctrl+H would give you 000 1000, or "backspace". Similarly, ctrl+J is 000 1010, or linefeed.
This is why pressing backspace in some programs gives you ^H btw.
4
11
88
Most teletype machines followed those conventions. Since ADM was a full terminal, it also needed keys for navigation without editing. ^H and ^J were already there and made sense, and so it was naturally to extend the ^K and ^L control codes to also be navigation.
1
3
29
So ADM didn't put the arrow keys above hjkl arbitrarily. It put them there because the arrow keys literally _were_ the control codes ^H through ^L. If H and J weren't adjacent on QWERTY or the ASCII controls were arranged slightly differently, ADM would have done something else.
3
7
48
Fun Epilogue: the 1963 ASCII standard says it included enough characters to fully express COBOL, but ALGOL had so many special characters it gave up. And that's why most keyboards don't support → or ≠
4
10
75




