In 1976, Bill Joy was a graduate student at the University of California, Berkeley, editing computer code from home in Berkeley. He recalled using a terminal and a telephone modem running at about 300 baud—transmitting roughly thirty characters each second. Before developing the vi text editor, Joy worked with ed, the standard line editor in Unix, which displayed text only when asked. To inspect a routine, a programmer typed commands, pressed enter, and waited while the terminal printed each line character by character.
When Joy set out to create a full-screen display editor that later became vi, he faced an unforgiving physical constraint: sending eighty characters across each of twenty-four lines would take more than a minute over that telephone link. Updating only the necessary parts of the display helped make editing practical.
Editing Code Line by Line
In the mid-1970s, Unix ran on shared minicomputers such as Digital Equipment Corporation’s PDP-11 (Programmed Data Processor-11). Early users interacted with machines through electromechanical teletypes that printed output directly onto continuous rolls of paper. In that environment, Ken Thompson’s editor ed was an elegant fit. It let programmers address lines by number, substitute words with regular expressions, and print selected ranges to inspect the surrounding code.
By 1976, glass cathode-ray tube terminals were replacing paper teletypes across computer science departments. Video terminals could display twenty-four lines of text at once, but ed still treated the glass screen like an endless roll of paper, printing requested lines at the bottom and scrolling old lines upward into oblivion. Programmers who had seen early experimental display editors knew editing could feel immediate. If the screen displayed the current file continuously and a blinking cursor marked the editing position, typos could be fixed where they stood.
Joy was working on a Pascal compiler that Thompson had brought to Berkeley. Debugging large programs through ed was excruciatingly slow, especially when working remotely over telephone lines. If the editor printed the wrong block of code, the programmer lost minutes waiting for the text to finish streaming across the modem. Joy wanted an editor that showed the surrounding code as a coherent page.
The Path from em to ex
The breakthrough began in the summer of 1976, when British computer scientist George Coulouris visited Berkeley from Queen Mary College, University of London. Coulouris had developed an editor called em (short for “editor for mortals”) in the autumn of 1975. Taking ed as a foundation, Coulouris modified the program so that users could edit character by character within a single displayed line on video terminals. Coulouris showed em to Joy at Berkeley, and Joy and his colleagues copied its source code.
Joy took Coulouris’s code as a starting point. Chuck Haley implemented many of the changes from em to the initial releases of ex, and Joy credited his collaboration and mentorship. In his 1999 interview, Joy recalled an intermediate name, en, although he was uncertain about the naming sequence. The first Berkeley Software Distribution (1BSD) included ex 1.1. Although ex retained line-oriented commands, version 1.1 already offered visual mode for screen-oriented editing on terminals capable of positioning the cursor.
Designing for a 300-Baud Modem
Faster local connections made full-screen editing more practical by reducing the time needed to update the display. At 300 baud, however, refreshing the display after every command was impossible. Sending eighty characters across each of twenty-four lines would require 1,920 characters, taking about sixty-four seconds at thirty characters per second before additional control sequences. If pressing a key caused the screen to repaint, the editor became unusable.
Joy solved the problem by treating screen updates as a scarce resource to be minimized at every step. Rather than always repainting the display, vi used available terminal operations such as cursor positioning, clearing to the end of a line, and character insertion or deletion. The early editor recorded terminal characteristics in /etc/ttycap, though adding cursor addressing for another terminal required recompilation.
For slow connections, Joy introduced structural adaptations into the editor’s design. When running at 300 baud, ex and vi automatically reduced the default editing window to half the screen, requiring far fewer lines to refresh. At 1200 baud, the default window expanded to two-thirds of the screen. These were initial defaults: users could enlarge the window even on slow connections. Joy also introduced the slowopen option, which suspended visual updates while the user typed new text, restoring the deferred display content when the user pressed Escape to end insertion.
The command grammar itself reflected the same pressure for brevity. Many basic commands were short and needed no Return: “dw” to delete a word, “yy” to copy a line, and “p” to put copied or deleted text after the current position. Searches, counts, and colon commands could require longer input and, for searches and colon commands, a terminator. Joy designed vi to remain useful when screen updates lagged behind the user’s typing. Typeahead had system-dependent limitations: the contemporary manual warns that some systems did not allow it during computation while the cursor was on the bottom row.
The Myth of the Weekend Hack
A persistent legend in developer lore holds that Bill Joy wrote vi in a single manic weekend. In a 1999 interview with Linux Magazine, later reprinted by The Register, Joy dismissed that premise outright. When asked if the editor came together in a weekend, he replied: “No. It took a long time.” Elsewhere in the interview, he recalled staying up all night for a few months to write vi.
Visual editing was already documented in ex 1.1 in November 1977. Ex 2.0, included in the Second Berkeley Software Distribution (2BSD), expanded that interface and introduced direct startup through the vi command. Invoking ex with the “-v” flag launched the full-screen interface, and a simple link named vi was created to let programmers open visual mode directly.
The Constraints That Outlived the Bottleneck
Joy’s 1999 recollection emphasized how different his early computing environment had been. Design choices made for that slow connection remained visible in vi. Its descendant Vim still retains vi’s distinction between Normal mode for editing commands and Insert mode for entering text.
Joy attributed vi’s unusual commands and the difficulty of making screen editing practical to his 300-baud connection. At thirty characters a second, every unnecessary redraw made the programmer wait.
Related stories
Sources
- The Register: Bill Joy’s greatest gift (Ashlee Vance, 2003)
- The story of em (George Coulouris, 1998/2012)
- An Introduction to Display Editing with Vi (William Joy, 2BSD, TUHS)
- Ex Reference Manual, Version 2.0 (William Joy, April 1979, TUHS)
- Ex differences — version 1.1 to 2.0 (TUHS archive)
- Featured image: Joi Ito from Inbamura, Japan; Wikimedia Commons; CC BY 2.0 (adapted from the original)

Leave a Reply