From ed to Vim: The Untold History of Text Editing
This article traces the evolution of Unix text editors—from the early line editor ed, through QED, ex, and vi, to the modern Vim—explaining how historical decisions shaped features like :wq, yanking, and syntax highlighting, and why Vim remains a dominant tool for developers today.
Vim’s automatic filetype detection
When an Intel HEX file (extension .hex) is opened, Vim automatically sets the filetype to hex and applies distinct syntax colours to each field of the record. The command :set ft? returns filetype=hex, demonstrating Vim’s built‑in support for obscure formats.
Historical lineage of vi‑like editors
Vim inherits its core concepts from a chain of Unix editors that began in the 1960s.
QED and ed
Ken Thompson rewrote the QED editor for the MIT‑compatible time‑sharing system at Bell Labs and later for the Multics project. In 1969, Thompson and Dennis Ritchie created the first Unix system and a line editor named ed, a simplified, POSIX‑compatible descendant of QED. ed dropped multi‑buffer editing, command‑buffer execution, and advanced regular‑expression support, making it suitable for teleprinters that re‑printed the whole file after each change.
Key ed commands that survive in Vim include: w – write the buffer to disk q – quit the editor wq – write and quit (combined) s/foo/bar/g – substitute globally
Example ed session (lines prefixed with # are comments for illustration):
# Open a file
e sample.txt
# Print the first three lines
1,3p
# Append a new line after line 3
3a
New line of text.
.
# Substitute "foo" with "bar" globally
%s/foo/bar/g
# Write changes and quit
wqex and vi
In 1975 George Coulouris created em, a screen‑oriented line editor. Bill Joy used em as a basis to develop ex, which added an “open” (single‑line) mode and a full‑screen “visual” mode. The 1979 BSD release introduced vi, an executable that extended ex ’s visual capabilities.
Joy’s use of the ADM‑3A terminal, which lacked arrow keys, led to the now‑standard navigation keys h, j, k, l. The colon ( :) became the command‑line prefix, and the wq convention for write‑and‑quit originated here.
Open‑source clones such as STEVIE (1987), Elvis (1990) and nvi (1994) added features like syntax highlighting and split windows; Elvis’s enhancements later influenced Vim.
Creation and evolution of Vim
Bram Moolenaar, working on an Amiga 2000, needed a vi‑compatible editor. Using the STEVIE source from the Fred Fish disk as a foundation, he released the first version of Vim (Vi IMproved) in 1991, prioritising vi compatibility while adding multi‑level undo and a “quickfix” mode for compiler error navigation.
Subsequent releases added major features:
Vim 2.0 (1993) – wrap handling and horizontal scrolling for long lines.
Vim 3.0 – split windows and buffer management (inspired by nvi).
Swap‑file recovery – protects unsaved changes after a crash.
Vimscript – scripting language introduced in Vim 5.0.
Syntax highlighting – also in Vim 5.0.
Vim was ported to DOS, Windows, macOS and many Unix variants, eventually becoming the most popular terminal‑based editor (25.8 % of developers in the 2018 Stack Overflow survey).
Technical impact
The editor’s longevity stems from incremental, collaborative development rooted in the Unix philosophy: each generation added modest, well‑tested extensions while preserving backward compatibility. Vim’s modal editing model, command syntax ( :%s/foo/bar/gc, :wq, yanking with y, etc.) and extensive configurability are direct descendants of the original ed, ex and vi designs.
Illustrative screenshots
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
