# Vi (text editor)

**vi** is a screen-oriented (visual) text editor for Unix systems, written by [Bill Joy](https://www.edgepedia.org/bill-joy) in 1976 at the [University of California](https://www.edgepedia.org/university-of-california), Berkeley as a full-screen visual mode on top of the line editor ex.<sup>[1](https://www.herongyang.com/Computer-History/Vi-Text-Editor-by-Bill-Joy-in-1976.html)</sup><sup> • </sup><sup>[2](https://thingshavehistory.com/posts/ed/)</sup> It is defined by its modal design, in which the keyboard alternates between entering text and issuing commands, and it remains a standard part of Unix and [Unix-like](https://www.edgepedia.org/unix-like) systems, required by POSIX on terminals that qualify.<sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup>

| Key fact | Detail |
|---|---|
| Author and date | Bill Joy, 1976, University of California, Berkeley<sup>[1](https://www.herongyang.com/Computer-History/Vi-Text-Editor-by-Bill-Joy-in-1976.html)</sup> |
| Lineage | ed → em (George Coulouris) → en → ex → vi, with vi as the visual mode of ex<sup>[2](https://thingshavehistory.com/posts/ed/)</sup><sup> • </sup><sup>[4](https://www.theregister.com/software/2003/09/11/bill-joys-greatest-gift-to-man-the-vi-editor/665421)</sup> |
| Original hardware | Lear-Siegler ADM-3A screen-addressable terminal at Berkeley<sup>[5](https://softpanorama.org/Editors/Vimorama/history.shtml)</sup> |
| Interfaces | ex (line-oriented), vi (screen-oriented), and view (read-only) are interfaces to the same program<sup>[6](https://man.openbsd.org/vi.1)</sup> |
| Standardization | Required by POSIX.1-2017 on systems that support the User Portability Utilities option and define POSIX2_CHAR_TERM<sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup> |
| Common implementations | nvi (OpenBSD, FreeBSD documentation), Vim (most Linux distributions ship a vi command that is Vim or vim.tiny)<sup>[6](https://man.openbsd.org/vi.1)</sup><sup> • </sup><sup>[7](https://github.com/vim/vim/blob/master/README.md)</sup> |

## Origin

The direct ancestor of vi is `ed`, the line editor [Ken Thompson](https://www.edgepedia.org/ken-thompson) wrote for the first releases of Unix. `ed` begat `ex`, a somewhat less hostile variant, and `ex` begat `vi`, which Bill Joy wrote at Berkeley in 1976 by adding a full-screen visual mode on top of `ex`.<sup>[2](https://thingshavehistory.com/posts/ed/)</sup> The name itself reflects this: vi was originally just the command that started the ex editor in its visual mode.<sup>[8](https://picture.iczhiku.com/resource/eetop/WYiDrtPASjpZyBNN.pdf)</sup>

Joy's own account places the work in the summer of 1976, when he and Chuck Haley had a job fixing a Pascal interpreter that Ken Thompson had brought to Berkeley. While fixing it, they were frustrated with `ed`, obtained `em` ("Editor for Mortals") from George Coulouris at [University College London](https://www.edgepedia.org/university-college-london), modified it into `en`, and eventually arrived at `ex`.<sup>[4](https://www.theregister.com/software/2003/09/11/bill-joys-greatest-gift-to-man-the-vi-editor/665421)</sup> In his [Computer History Museum](https://www.edgepedia.org/computer-history-museum) oral history, Joy describes the same sequence: "We also took the UNIX editor, which is a little bit obscure, ED, and another editor called EM, which we'd gotten from England and fixed it up to be EX."<sup>[9](https://archive.computerhistory.org/resources/access/text/2022/06/102743073-05-01-acc.pdf)</sup>

The screen hardware mattered. The original Unix editors `ed` and later `ex` were line-oriented because users worked over teletypes; in 1976 Joy had access to a screen-oriented ADM-3A terminal, and when Berkeley received a batch of ADM-3a terminals with screen-addressable cursors, he rewrote `em` into `vi`, a truly visual editor.<sup>[10](https://www.harley.com/unix-book/book/chapters/22.html)</sup><sup> • </sup><sup>[5](https://softpanorama.org/Editors/Vimorama/history.shtml)</sup> Joy later said he had a terminal at home and a 300 baud modem, "so the cursor could move around and I just stayed up all night for a few months and wrote vi."<sup>[4](https://www.theregister.com/software/2003/09/11/bill-joys-greatest-gift-to-man-the-vi-editor/665421)</sup> Coulouris, visiting Berkeley that summer, recalled sitting at the terminal next to Joy and said that "a full-screen editor is a lot more work to write and Bill deserves most of the credit he has received."<sup>[4](https://www.theregister.com/software/2003/09/11/bill-joys-greatest-gift-to-man-the-vi-editor/665421)</sup> Between 1976 and 1979 ex evolved into vi, and despite the changes, vi's core was and is the original Unix `ed` editor.<sup>[11](https://www.oreilly.com/library/view/learning-the-vi/1565924266/1565924266_vi6-ch-9-sect-1.html)</sup>

## Modes and command structure

vi is a modeful editor: you are either entering text or executing commands, and you must be in the right mode to do either. A session starts in command mode; commands such as `a` (append), `i` (insert), `o` and `O` (open a line below or above) switch into input mode, and the escape key is the single key that returns to command mode.<sup>[6](https://man.openbsd.org/vi.1)</sup> This modal split is the feature most often cited as confusing new users, since keys typed in the wrong mode perform commands rather than inserting characters.<sup>[12](https://www.cs.csi.cuny.edu/~gu/teaching/courses/csc429/slides/VI.pdf)</sup>

Command-mode commands follow a compositional grammar. A `count` (a positive number, defaulting to 1) repeats a command; a `motion` command supplies the other end of the affected text region, with the cursor as the first end; and when both are present they are effectively multiplied together. A `word` is a sequence of letters, digits, or underscores, and a `bigword` is a set of non-whitespace characters, giving two granularities of word motion.<sup>[6](https://man.openbsd.org/vi.1)</sup> Core operations include `dd` to delete the current line, `yy` to copy ("yank") it, `p` to paste, `x` to delete a character, and `u` to undo the last change; `:w` writes the file and `:q` quits, with `:q!` discarding modifications.<sup>[6](https://man.openbsd.org/vi.1)</sup>

**Buffers and registers.** A buffer is an area where commands save changed or deleted text for later use. Buffers are named with a single character preceded by a double quote; buffers `a` through `z` can be addressed in uppercase to append rather than replace content, and the numeric buffers `1` through `9` hold recent deletions in a rotating stack, with the contents of buffer `9` discarded on each shift.<sup>[6](https://man.openbsd.org/vi.1)</sup>

**Regular expressions and ex commands.** vi supports regular expressions for line addresses, search patterns, and the ex `substitute`, `global`, and `v` commands. Basic regular expressions are the default; extended regular expressions are used when the `extended` option is enabled, and the `magic` option can largely disable special meanings. Pressing `:` in command mode executes an ex command, so the line-editor heritage remains directly reachable from the screen interface.<sup>[6](https://man.openbsd.org/vi.1)</sup>

## ex, vi, and view

`ex` works line by line, while `vi` works on the full screen; both are simply two modes of a single program, and a user may move between them at any point while editing. `view` corresponds to launching `vi` with its `-R` (read-only) flag.<sup>[6](https://man.openbsd.org/vi.1)</sup> The POSIX specification describes vi the same way, as a screen-oriented (visual) display editor whose open and visual modes it standardizes, with the line editor ex providing additional capabilities; the user can switch between vi and ex and execute ex commands from within vi.<sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup> All editing changes are performed on an edit buffer, and no changes affect any file until an editor command writes it.<sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup>

## Implementations

The original vi shipped with the [Berkeley Software Distribution](https://www.edgepedia.org/berkeley-software-distribution). The version documented in the OpenBSD manual page and the FreeBSD Vi/Ex Reference Manual is `nex`/`nvi`, intended as bug-for-bug compatible replacements for the original 4BSD `ex` and `vi` programs.<sup>[6](https://man.openbsd.org/vi.1)</sup><sup> • </sup><sup>[13](https://docs-archive.freebsd.org/44doc/usd/13.viref/paper.pdf)</sup> nvi adds features the historic versions lacked, including 8-bit clean data and large files, background and foreground screens, editing of the colon command-line history, extended regular expressions, file name completion, infinite undo with redo, left-right scrolling, message catalogs for translated messages, and the `exusage` and `viusage` commands that print usage for any ex or vi command.<sup>[13](https://docs-archive.freebsd.org/44doc/usd/13.viref/paper.pdf)</sup>

**Vim.** Vim, first released in 1991, is a greatly improved version of vi that adds multi-level undo, syntax highlighting, command-line history, online help, spell checking, filename completion, block operations, and a built-in script language, while maintaining vi compatibility so that users with vi "in the fingers" feel at home.<sup>[7](https://github.com/vim/vim/blob/master/README.md)</sup> Vim is backwards compatible with vi and offers a vi compatibility mode in which all improvements that make it incompatible are turned off, leaving a 100% vi-compatible editor.<sup>[14](https://www.vim.org/viusers.php)</sup> When compiled with a minimal feature set (typically called vim.tiny), Vim aims to provide a mostly POSIX-compatible vi implementation and is used by many Linux distributions as the default vi editor.<sup>[7](https://github.com/vim/vim/blob/master/README.md)</sup> Vim also extends the platform reach: vi-compatible editors are available on Unix and non-Unix platforms, while Vim runs on MS-Windows, macOS, Haiku, VMS, and almost all flavors of Unix.<sup>[14](https://www.vim.org/viusers.php)</sup>

## Standardization and persistence

POSIX.1-2017 mandates the vi utility only where a system offers the User Portability Utilities option and also sets the POSIX2_CHAR_TERM symbol, leaving it optional elsewhere.<sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup> The standard also records where it deliberately broke with historical behavior, for example requiring that groups of empty or blank lines be treated as a single entity by all vi commands, and that the `<` and `>` shift commands always move the cursor to the first non-blank character rather than sometimes leaving it unchanged.<sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup>

That standard status explains the editor's persistence. Vim is included as "vi" with most Unix systems and with Apple OS X.<sup>[15](https://www.vim.org/)</sup> Nearly half a century after Joy wrote it, the modal command language he built for a 300 baud connection to an ADM-3A remains the editing interface available by default on essentially every Unix-like system a user might log into.<sup>[4](https://www.theregister.com/software/2003/09/11/bill-joys-greatest-gift-to-man-the-vi-editor/665421)</sup><sup> • </sup><sup>[3](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)</sup>

## References

1. [1976 – vi Text Editor Developed by Bill Joy, Herong Yang](https://www.herongyang.com/Computer-History/Vi-Text-Editor-by-Bill-Joy-in-1976.html)
2. [ed: the editor that still ships with every Unix, Things Have History](https://thingshavehistory.com/posts/ed/)
3. [vi, POSIX.1-2017, The Open Group](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html)
4. [Bill Joy's greatest gift to man – the vi editor, The Register (2003)](https://www.theregister.com/software/2003/09/11/bill-joys-greatest-gift-to-man-the-vi-editor/665421)
5. [History of VI editor and its derivatives, Softpanorama](https://softpanorama.org/Editors/Vimorama/history.shtml)
6. [vi(1), OpenBSD manual pages](https://man.openbsd.org/vi.1)
7. [Vim README, vim/vim on GitHub](https://github.com/vim/vim/blob/master/README.md)
8. [vi is the original root of the Vim (course notes)](https://picture.iczhiku.com/resource/eetop/WYiDrtPASjpZyBNN.pdf)
9. [Oral History of Bill Joy, Computer History Museum](https://archive.computerhistory.org/resources/access/text/2022/06/102743073-05-01-acc.pdf)
10. [Harley Hahn's Guide to Unix and Linux, Chapter 22](https://www.harley.com/unix-book/book/chapters/22.html)
11. [Author and History, Learning the vi Editor, Sixth Edition, O'Reilly](https://www.oreilly.com/library/view/learning-the-vi/1565924266/1565924266_vi6-ch-9-sect-1.html)
12. [VI (Visual) Editor Reference manual, CUNY CSI](https://www.cs.csi.cuny.edu/~gu/teaching/courses/csc429/slides/VI.pdf)
13. [Vi/Ex Reference Manual (USD:13), FreeBSD 4.4BSD documents](https://docs-archive.freebsd.org/44doc/usd/13.viref/paper.pdf)
14. [for Vi users, vim online](https://www.vim.org/viusers.php)
15. [welcome home : vim online](https://www.vim.org/)

---
*Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Software and programming › Development tools and collaboration infrastructure › Build, deployment, and development tooling*

*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
