F/OSS Comics

12. BSD Unix, Part 2 - The Birth of the vi Editor

Posted on Oct 11, 2026

In 1975, Ken Thompson returned to his alma mater, UC Berkeley, for a sabbatical as a visiting professor. He was getting Unix Version 6 running on the new PDP-11/70.[2]

That's Ken Thompson. He created Unix. Maybe we can help.

Who are those two? They've been following me for days.

The PDP-11/70 machine room.

Professor, can we help?

Hello at last.

Ha! Plenty to do.

I'm improving a Pascal interpreter. Want to help?

Sure!

Bill Joy and Chuck Haley improved the Pascal system so programs compiled faster and ran faster. It became popular with students.[2]

The birth of vi

Unix came with ed, a line editor Thompson had written in 1969 during Unix's early development.[4]

Isn't ed awkward to use?

I wrote it for teletypes. Still works for me...

Wait... how do you edit a document with ed?

Here is a short ed session. Commands, typed text, and output appear together. The $ prompts belong to the shell; ed itself normally has no prompt.[6]

$ ed
a
ed is the standard Unix text editor.
This is line number one.
.
,p
ed is the standard Unix text editor.
This is line number one.
2s/one/two/
,p
ed is the standard Unix text editor.
This is line number two.
w text
62
q
$ cat text
ed is the standard Unix text editor.
This is line number two.

The a command starts appending text. A period on a line by itself ends input. The command ,p prints every line in the buffer.

To change one to two on the second line, you enter 2s/one/two/. Instead of moving a cursor over the text, you specify the line and the substitution. Then w text saves the buffer to a file named text, reporting its size in bytes, and q quits.

The resulting file contains:

ed is the standard Unix text editor.
This is line number two.

In the 1960s, memory was scarce and modems were slow. Many terminals printed onto paper rather than displaying text on a screen. An editor with short commands made sense on terminals like these.[4]

A yellow Teletype Model 33 with a keyboard and paper roll.

The Teletype Model 33, a widely used printing terminal.

By the 1970s, terminals with CRT screens were becoming common. Unix users were still editing with ed.

We have a screen. Why edit like this?

In the summer of 1976, George Coulouris visited Berkeley from Queen Mary College.[5]

Bill! His editor, em, lets you edit a line right on the screen.

That's what I need.

Here's the em source tape. It'll show you how it handles a video terminal.

Thanks, Professor.

Joy and Haley built on em to develop ex. In 1977, Joy added the full-screen visual mode that became vi.[2][3]

Now I'll add a full-screen visual mode to ex.

Coding's a lot more fun in visual mode.

The visual mode became popular with BSD users. Starting the editor with the vi command opened it directly in visual mode. You can still use ex commands in vi today.[3]

The West Coast Unix Users Group

Back to Thompson's time at Berkeley, in 1975-1976.

Thompson also shared his knowledge of Unix. At early meetings of the West Coast Unix Users Group, he walked participants through the kernel source, line by line, over a series of evenings.[1]

Did everyone bring their printouts?

Too long!

That tradition of sharing code and explaining how it worked carried through BSD into the broader free and open source software community. At the time, however, Unix source and early BSD distributions were shared with holders of AT&T source licenses.[1][2]

At the end of the summer of 1976, Thompson returned to Bell Labs after his sabbatical.[2]

Goodbye, Professor!

Back to Bell Labs. Happy hacking!

References

  1. Andrew Leonard, BSD Unix: Power to the people, from the code, 2000.
  2. Marshall Kirk McKusick, Twenty Years of Berkeley Unix, in Open Sources: Voices from the Open Source Revolution, 1999. The Korean edition, referenced in the original comic, was published by Hanbit Media in 2013.
  3. vi (text editor), Wikipedia.
  4. ed (text editor), Wikipedia.
  5. George Coulouris, Bits of History, a firsthand account of em and his 1976 visit to Berkeley.
  6. GNU ed manual.