page_title: Vi
section_title: Ports and clones
hierarchical_section_title: Vi / History / Ports and clones
caption_attribution_description: English: The vi editor in OpenBSD 5.3, as it appears when starting the editor without any file selected. This is the "nvi" ("new vi") implementation made by Berkeley CSRG after the AT&amp;T lawsuits. Running in a QEMU VM.
context_page_description: vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by the Single Unix Specification and POSIX.
  The original code for vi was written by Bill Joy in 1976, as the visual mode for a line editor called ex that Joy had written with Chuck Haley. Bill Joy's ex 1.1 was released as part of the first Berkeley Software Distribution Unix release in March 1978. It was not until version 2.0 of ex, released as part of Second BSD in May 1979 that the editor was installed under the name "vi", and the name by which it is known today. Some current implementations of vi can trace their source code ancestry to Bill Joy; others are completely new, largely compatible reimplementations.
  The name "vi" is derived from the shortest unambiguous abbreviation for the ex command visual, which switches the ex line editor to visual mode. The name is pronounced.
context_section_description: Up to version 3.7 of vi, created in October 1981, UC Berkeley was the development home for vi, but with Bill Joy's departure in early 1982, to join Sun Microsystems, and AT&T's UNIX System V (January 1983) adopting vi, changes to the vi codebase happened more slowly and in a more dispersed and mutually incompatible way. At UC Berkeley, changes were made but the version number was never updated beyond 3.7. Commercial Unix vendors, such as Sun, HP, DEC, and IBM each received copies of the vi source, and their operating systems, Solaris, HP-UX, Tru64 UNIX, and AIX, today continue to maintain versions of vi directly descended from the 3.7 release, but with added features, such as adjustable key mappings, encryption, and wide character support.
  While commercial vendors could work with Bill Joy's codebase (and continue to use it today), many people could not. Because Joy had begun with Ken Thompson's ed editor, ex and vi were derivative works and could not be distributed except to people who had an AT&T source license. People looking for a free Unix-style editor would have to look elsewhere. By 1985, a version of Emacs (MicroEMACS) was available for a variety of platforms, but it was not until June 1987 that STEVIE (ST Editor for VI Enthusiasts), a limited vi clone, appeared. In early January 1990, Steve Kirkendall posted a new clone of vi, Elvis, to the Usenet newsgroup comp.os.minix, aiming for a more complete and more faithful clone of vi than STEVIE. It quickly attracted considerable interest in a number of enthusiast communities. Andrew Tanenbaum quickly asked the community to decide on one of these two editors to be the vi clone in Minix; Elvis was chosen, and remains the vi clone for Minix today.
  In 1989 Lynne Jolitz and William Jolitz began porting BSD Unix to run on 386 class processors, but to create a free distribution they needed to avoid any AT&T-contaminated code, including Joy's vi. To fill the void left by removing vi, their 1992 386BSD distribution adopted Elvis as its vi replacement. 386BSD's descendants, FreeBSD and NetBSD, followed suit. But at UC Berkeley, Keith Bostic wanted a "bug for bug compatible" replacement for Joy's vi for BSD 4.4 Lite. Using Kirkendall's Elvis (version 1.8) as a starting point, Bostic created nvi, releasing it in the northern spring of 1994. When FreeBSD and NetBSD resynchronized the 4.4-Lite2 codebase, they too switched over to Bostic's nvi, which they continue to use today.
  Despite the existence of vi clones with enhanced featuresets, sometime before June 2000, Gunnar Ritter ported Joy's vi codebase (taken from 2.11BSD, February 1992) to modern Unix-based operating systems, such as Linux and FreeBSD. Initially, his work was technically illegal to distribute without an AT&T source license, but, in January 2002, those licensing rules were relaxed, allowing legal distribution as an open-source project. Ritter continued to make small enhancements to the vi codebase similar to those done by commercial Unix vendors still using Joy's codebase, including changes required by the POSIX.2 standard for vi. His work is available as Traditional Vi, and runs today on a variety of systems.
  But although Joy's vi was now once again available for BSD Unix, it arrived after the various BSD flavors had committed themselves to nvi, which provides a number of enhancements over traditional vi, and drops some of its legacy features (such as open mode for editing one line at a time). It is in some sense, a strange inversion that BSD Unix, where Joy's vi codebase began, no longer uses it, and the AT&T-derived Unixes, which in the early days lacked Joy's editor, are the ones that now use and maintain modified versions of his code.
caption: The vi editor in OpenBSD (nvi) on startup, editing a temporary empty file
exif: {}