vi, or the editor that made modes out of necessity
On a Lear Siegler ADM-3A terminal, the keyboard has no dedicated cursor keys. Instead, tucked into the home row, the letters h, j, k, and l have small arrows engraved alongside their letters — a quiet hardware decision that nobody at Lear Siegler intended as a contribution to software design. Bill Joy made it one.
Joy was a twenty-one-year-old graduate student at UC Berkeley, working from what he later described as “World War II surplus housing”, connected to the university mainframe through a 300-baud telephone modem. At 300 baud, a 24-line screen refills in about ten seconds — slow enough to teach you to think in keystrokes before committing them to the wire. Every command had to be one character if it could possibly be one character.
The editor he was building had roots in a visitor’s luggage. In the summer of 1976, George Coulouris of Queen Mary College, London, arrived at Berkeley carrying the source code for em — which he had called “the Editor for Mortals,” to distinguish it from ed, which answered every question with a period and every mistake with silence. Joy and fellow student Chuck Haley took em’s code, built en, then “extended” it into a line editor they called ex. Between June and October 1977, Joy added the step that separated ex from every line editor before it: a full-screen visual mode. You could see your text. You could move through it with those four home-row arrows.
He named the visual mode vi — short for “visual,” a word whose modesty understates its effect. Vi is not technically a separate program from ex. In version 2.0, vi is a hard link to ex that starts automatically in visual mode. They are one program with two faces.
The theft Joy freely admitted: “A lot of the ideas for the screen editing mode were stolen from a Bravo manual I surreptitiously looked at.” Bravo was Xerox PARC’s bimodal word processor — the same PARC that produced the mouse, the GUI, and the laser printer. Joy had heard about Bravo’s two-mode design, obtained the manual through means he described only as “surreptitious,” and applied the modal architecture to his visual layer. He stayed up most nights for a few months to do it.
Ex 1.1 shipped with the first Berkeley Software Distribution in March 1978. Vi arrived as its own named command in Second BSD, May 1979. It spread with Unix because it shipped free — a fact Joy credited for its dominance over every commercial rival.
The modal architecture is what survived. Insert mode and command mode, the two faces of one program, divided the editing world into camps that have argued about the philosophy for half a century. Vim, Bram Moolenaar’s compatible rewrite, appeared in 1991 and extended vi’s keystrokes for another thirty years. The hjkl navigation cluster that Joy inherited from ADM-3A hardware now appears in Neovim, Helix, and the keyboard-shortcut menus of Gmail and GitHub. The ADM-3A hasn’t been manufactured since the early 1980s. The key layout it printed on h, j, k, and l is still shipping.
Sources
- vi (text editor) — Wikipedia — Creation timeline, George Coulouris and the em lineage, Chuck Haley, the ADM-3A terminal, the Bravo manual admission, the ex/vi hard-link relationship, BSD release dates.
- Bill Joy’s greatest gift to man — The Register, 2003 — Joy’s own description of the WWII surplus housing, the 300-baud modem, and his account of staying up nights to write vi.