Bill Joy used an ADM 3A[1] terminal, and looking at the keyboard layout explains vi's key mappings almost entirely.

There are arrow keys printed on HJKL (accessed via control), escape is left of Q, control is left of A, and colon has a dedicated key rather than being shift+semicolon.

Another tidbit is that the home key is also used for tilde, which explains its association with the home directory.

1: https://en.wikipedia.org/wiki/ADM-3A#/media/File:KB_Terminal...

This makes so much sense, and now looking at this image, I wonder if it explains "tabs vs spaces".

It does seem like an additional reason, but I'm convinced tabs were (are?) disliked primarily for historical and technological reasons. Historically the tab key worked with a tab stop; there's always friction when you switch paradigms. Technologically, accommodating a variable width non-printing character on an 80x25 character-mapped display for no particular reason must have seemed both gratuitous and wasteful when you consider the typical hardware of the time (monochrome terminals, CPUs on the order of 1-50 MHz, 1-5 MB RAM, < 1 MB ROM, etc).

> disliked primarily for historical and technological reasons

Huh? AFAIU, all the historical source code uses tabs for indentation. Both K&R and BSD style uses hard tabs, as does Linux kernel style and most older GNU project code for that matter. Various Unix programs assume tabs, for example indentation elision in shell heredoc syntax ("<<-") only works for tabs.

Soft tabs (spaces) has been a relatively new thing in the C/Unix world. You may not notice it because, working as well as they do, hard tabs magically indent according to your local preference, so hard tabs aren't noticeable.[1]

[1] What doesn't work is right-hand alignment. That's most noticeable in modern BSD code, where the style is to tab-align variable types and names into different columns. If your tab stop isn't set to 8 (the required tab stop), they don't line up. Most hard tabbers don't mix indentation and alignment, anymore.

EDIT: Here's the earliest source code for vi I could quickly find: https://github.com/n-t-roff/ex-2.2/blob/220a2cfa/ex.c It uses hard tabs. It's also still using pre-ANSI function syntax, suggesting this code wasn't cleaned up before committing to Git.

Ok apparently I'm super ignorant about this. WTF are people going on about spaces for if hard tabs are the historic standard? I always assumed that Go was progressive, C++ was the norm (ie had no preference), Python and Nim were designed by diehards clinging to the past, and that people were exhibiting their rather famous resistance to change. Apparently this is completely wrong?

I seem to have made assumptions due to only running into spaces in "old" places such as Python, Vim, Emacs, etc. To be fair, this all happened well before I was born. Why would software developers of all people try to do away with a useful abstraction?!

Oddly, the linked keyboard doesn't appear to have a tab key but the Vi source code you found contains them? Am I missing something obvious?

(`/* Copyright (c) 1979 Regents of the University of California */`, that's some impressively old code to find on GitHub.)

Re BSD: Yeah, tabs don't work for alignment almost by definition. I'm surprised anyone was crazy enough to author a code style that called for it.

Bit strange thinking of Python as "old" .. anyway, what I suspect happened was that tabs were the "new" innovation - in the post-punchcard era. Punchcards couldn't meaningfully have a tab character, but they could have fixed character positions, and this feature was required by COBOL and FORTRAN in their day. It was still present in the F77 standard.

I think the other thing that got in the way of standardising on TAB was that 8 character indent is too much, but once you let people configure it it's no longer consistent between systems.

> that's some impressively old code to find on GitHub

You may like https://github.com/chrislgarry/Apollo-11