Vi (text Editor)
   HOME

TheInfoList



OR:

vi (pronounced as distinct letters, ) is a screen-oriented
text editor A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be us ...
originally created for the
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
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 (and thus standardized by) the Single Unix Specification and
POSIX The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming interf ...
. The original code for vi was written by
Bill Joy William Nelson Joy (born November 8, 1954) is an American computer engineer and venture capitalist. He co-founded Sun Microsystems in 1982 along with Scott McNealy, Vinod Khosla, and Andy Bechtolsheim, and served as Chief Scientist and CTO at ...
in 1976, as the visual
mode Mode ( la, modus meaning "manner, tune, measure, due measure, rhythm, melody") may refer to: Arts and entertainment * '' MO''D''E (magazine)'', a defunct U.S. women's fashion magazine * ''Mode'' magazine, a fictional fashion magazine which is ...
for a
line editor In computing, a line editor is a text editor in which each editing command applies to one or more complete lines of text designated by the user. Line editors predate screen-based text editors and originated in an era when a computer operator typic ...
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 The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
(BSD)
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
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" (which took users straight into ex's visual mode), 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 In computing, a line editor is a text editor in which each editing command applies to one or more complete lines of text designated by the user. Line editors predate screen-based text editors and originated in an era when a computer operator typic ...
to its full-screen mode. The name is pronounced (the English letters ''v'' and ''i''). In addition to various non–
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
variants of vi distributed with proprietary implementations of Unix, vi was opensourced with
OpenSolaris OpenSolaris () is a discontinued open-source computer operating system based on Solaris and created by Sun Microsystems. It was also, perhaps confusingly, the name of a project initiated by Sun to build a developer and user community around th ...
, and several
free and open source software Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
vi clones exist. A 2009 survey of ''
Linux Journal ''Linux Journal'' (''LJ'') is an American monthly technology magazine originally published by Specialized System Consultants, Inc. (SSC) in Seattle, Washington since 1994. In December 2006 the publisher changed to Belltown Media, Inc. in Houston ...
'' readers found that vi was the most widely used text editor among respondents, beating
gedit gedit ( or ) is a text editor designed for the GNOME desktop environment. It was GNOME's default text editor and part of the GNOME Core Applications until GNOME version 42 in March 2022, which changed the default text editor to GNOME Text E ...
, the second most widely used editor, by nearly a factor of two (36% to 19%).


History


Creation

vi was derived from a sequence of UNIX command line editors, starting with ed, which was a line editor designed to work well on
teleprinter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Initia ...
s, rather than display terminals. Within
AT&T Corporation AT&T Corporation, originally the American Telephone and Telegraph Company, is the subsidiary of AT&T Inc. that provides voice, video, data, and Internet telecommunications and professional services to businesses, consumers, and government agen ...
, where ed originated, people seemed to be happy with an editor as basic and unfriendly as ed,
George Coulouris George Alexander Coulouris (1 October 1903 – 25 April 1989) was an English film and stage actor. Early life Coulouris was born in Manchester, Lancashire, England, the son of Abigail (née Redfern) anNicholas Coulouris a merchant of Greek o ...
recalls:
..for many years, they had no suitable terminals. They carried on with
TTY TTY may refer to: Communications and technology * Teleprinter or teletypewriter (TTY), an electromechanical typewriter paired with a communication channel ** Sometimes used more generally for any type of computer terminal ** Sometimes used for a v ...
s and other printing terminals for a long time, and when they did buy screens for everyone, they got
Tektronix 4014 The Tektronix 4010 series was a family of text-and-graphics computer terminals based on storage tube, storage-tube technology created by Tektronix. Several members of the family were introduced during the 1970s, the best known being the 11-inch 40 ...
s. These were large
storage tube Storage tubes are a class of cathode-ray tubes (CRTs) that are designed to hold an image for a long period of time, typically as long as power is supplied to the tube. A specialized type of storage tube, the Williams tube, was used as a main mem ...
displays. You can't run a screen editor on a storage-tube display as the picture can't be updated. Thus it had to fall to someone else to pioneer screen editing for Unix, and that was us initially, and we continued to do so for many years.
Coulouris considered the cryptic commands of ed to be only suitable for "immortals", and thus in February 1976, he enhanced ed (using Ken Thompson's ed source as a starting point) to make em (the "editor for mortals") while acting as a lecturer at
Queen Mary College Queen Mary University of London (QMUL, or informally QM, and previously Queen Mary and Westfield College) is a public university, public research university in Mile End, East London, England. It is a member institution of the federal University of ...
.''A Quarter Century of UNIX'', by Peter H. Salus, Addison-Wesley 1994, pages 139–142
(excerpt available online)
/ref> The em editor was designed for display terminals and was a single-line-at-a-time visual editor. It was one of the first programs on Unix to make heavy use of "raw terminal input mode", in which the running program, rather than the terminal device driver, handled all keystrokes. When Coulouris visited
UC Berkeley The University of California, Berkeley (UC Berkeley, Berkeley, Cal, or California) is a public university, public land-grant university, land-grant research university in Berkeley, California. Established in 1868 as the University of Californi ...
in the summer of 1976, he brought a
DECtape DECtape, originally called Microtape, is a magnetic tape data storage medium used with many Digital Equipment Corporation computers, including the PDP-6, PDP-8, LINC-8, PDP-9, PDP-10, PDP-11, PDP-12, and the PDP-15. On DEC's 32-bit systems, VA ...
containing em, and showed the editor to various people. Some people considered this new kind of editor to be a potential resource hog, but others, including
Bill Joy William Nelson Joy (born November 8, 1954) is an American computer engineer and venture capitalist. He co-founded Sun Microsystems in 1982 along with Scott McNealy, Vinod Khosla, and Andy Bechtolsheim, and served as Chief Scientist and CTO at ...
, were impressed. Inspired by em, and by their own tweaks to ed,
Bill Joy William Nelson Joy (born November 8, 1954) is an American computer engineer and venture capitalist. He co-founded Sun Microsystems in 1982 along with Scott McNealy, Vinod Khosla, and Andy Bechtolsheim, and served as Chief Scientist and CTO at ...
and Chuck Haley, both graduate students at
UC Berkeley The University of California, Berkeley (UC Berkeley, Berkeley, Cal, or California) is a public university, public land-grant university, land-grant research university in Berkeley, California. Established in 1868 as the University of Californi ...
, took code from em to make en, and then "extended" en to create ex version 0.1. After Haley's departure, Bruce Englar encouraged Joy to redesign the editor, (see Acknowledgments section at end of file) which he did June through October 1977 adding a full-screen visual mode to exwhich came to be vi. vi and ex share their code; vi is the ex
binary Binary may refer to: Science and technology Mathematics * Binary number, a representation of numbers using only two digits (0 and 1) * Binary function, a function that takes two arguments * Binary operation, a mathematical operation that t ...
launching with the capability to render the text being edited onto a
computer terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and ...
it is ex's visual mode. The name ''vi'' comes from the abbreviated ex command (vi) to enter the visual mode from within it. The longform command to do the same was visual, and the name ''vi'' is explained as a contraction of ''visual'' in later literature. vi is also the shell command to launch ex/vi in the visual mode directly, from within a
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses ** Thin-shell structure Science Biology * Seashell, a hard ou ...
. According to Joy, many of the ideas in this visual mode were taken from
Bravo Bravo(s) or The Bravo(s) may refer to: Arts and entertainment Music Groups and labels *Bravo (band), a Russian rock band * Bravo (Spanish group), represented Spain at Eurovision 1984 *Bravo Music, an American concert band music publishing company ...
the bimodal text editor developed at
Xerox PARC PARC (Palo Alto Research Center; formerly Xerox PARC) is a research and development company in Palo Alto, California. Founded in 1969 by Jacob E. "Jack" Goldman, chief scientist of Xerox Corporation, the company was originally a division of Xero ...
for the
Alto The musical term alto, meaning "high" in Italian (Latin: ''altus''), historically refers to the contrapuntal part higher than the tenor and its associated vocal range. In 4-part voice leading alto is the second-highest part, sung in choruses by ...
. In an interview about vi's origins, Joy said:
A lot of the ideas for the screen editing mode were stolen from a Bravo manual I surreptitiously looked at and copied. Dot is really the double-escape from Bravo, the redo command. Most of the stuff was stolen. There were some things stolen from ed—we got a manual page for the Toronto version of ed, which I think
Rob Pike Robert "Rob" Pike (born 1956) is a Canadian programmer and author. He is best known for his work on the Go programming language and at Bell Labs, where he was a member of the Unix team and was involved in the creation of the Plan 9 from Bell La ...
had something to do with. We took some of the regular expression extensions out of that.
Joy used a
Lear Siegler Lear Siegler Incorporated (LSI) is a diverse American corporation established in 1962. Its products range from car seats and brakes to weapons control systems for military fighter planes. The company's more than $2 billion-a-year annual sales come ...
ADM-3A The ADM-3A was an influential early video display terminal, introduced in 1976. It was manufactured by Lear Siegler and had a 12-inch screen displaying 12 or 24 lines of 80 characters. It set a new industry low single unit price of $995. Its "du ...
terminal. On this terminal, the
Escape key On computer keyboards, the Esc key (named ''Escape key'' in the international standard series ISO/IEC 9995) is a key used to generate the escape character (which can be represented as ASCII code 27 in decimal, Unicode U+001B, or ). The escape ...
was at the location now occupied by the
Tab key The tab key (abbreviation of tabulator key or tabular key) on a keyboard is used to advance the cursor to the next tab stop. History The word ''tab'' derives from the word ''tabulate'', which means "to arrange data in a tabular, or table, fo ...
on the widely used
IBM PC keyboard The keyboard for IBM PC-compatible computers is standardized. However, during the more than 30 years of PC architecture being frequently updated, many keyboard layout variations have been developed. A well-known class of IBM PC keyboards is the Mo ...
(on the left side of the alphabetic part of the keyboard, one row above the middle row). This made it a convenient choice for switching vi modes. Also, the keys ''h'',''j'',''k'',''l'' served double duty as cursor movement keys and were inscribed with arrows, which is why vi uses them in that way. The ADM-3A had no other cursor keys. Joy explained that the terse, single character commands and the ability to type ahead of the display were a result of the slow 300 baud modem he used when developing the software and that he wanted to be productive when the screen was painting slower than he could think.


Distribution

Joy was responsible for creating the first
BSD Unix The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
release in March, 1978, and included ex 1.1 (dated 1 February 1978) in the distribution, thereby exposing his editor to an audience beyond
UC Berkeley The University of California, Berkeley (UC Berkeley, Berkeley, Cal, or California) is a public university, public land-grant university, land-grant research university in Berkeley, California. Established in 1868 as the University of Californi ...
. Formatted: From that release of
BSD Unix The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
onward, the only editors that came with the Unix system were ed and ex. In a 1984 interview, Joy attributed much of the success of vi to the fact that it was bundled for free, whereas other editors, such as
Emacs Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
, could cost hundreds of dollars. Eventually it was observed that most ex users were spending all their time in visual mode, and thus in ex 2.0 (released as part of Second Berkeley Software Distribution in May, 1979), Joy created vi as a
hard link In computing, a hard link is a directory entry (in a directory-based file system) that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file acc ...
to ex, such that when invoked as vi, ex would automatically start up in its visual mode. Thus, vi is not the evolution of ex, vi ''is'' ex. Joy described ex 2.0 (vi) as a very large program, barely able to fit in the memory of a
PDP-11/70 The PDP-11 is a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of all models were sold, ...
, thus although vi may be regarded as a small, lightweight program today, it was not seen that way early in its history. By version 3.1, shipped with 3BSD in December 1979, the full version of vi was no longer able to fit in the memory of a PDP-11; the editor would be also too big to run on
PC/IX Interactive Systems Corporation (styled INTERACTIVE Systems Corporation, abbreviated ISC) was a US-based software company and the first vendor of the Unix operating system outside AT&T, operating from Santa Monica, California. It was founded in 19 ...
for the
IBM PC The IBM Personal Computer (model 5150, commonly known as the IBM PC) is the first microcomputer released in the IBM PC model line and the basis for the IBM PC compatible de facto standard. Released on August 12, 1981, it was created by a team ...
in 1984. Joy continued to be lead developer for vi until version 2.7 in June 1979, and made occasional contributions to vi's development until at least version 3.5 in August 1980. In discussing the origins of vi and why he discontinued development, Joy said:
I wish we hadn't used all the keys on the keyboard. I think one of the interesting things is that vi is really a
mode Mode ( la, modus meaning "manner, tune, measure, due measure, rhythm, melody") may refer to: Arts and entertainment * '' MO''D''E (magazine)'', a defunct U.S. women's fashion magazine * ''Mode'' magazine, a fictional fashion magazine which is ...
-based editor. I think as mode-based editors go, it's pretty good. One of the good things about
EMACS Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
, though, is its programmability and the modelessness. Those are two ideas which never occurred to me. I also wasn't very good at optimizing code when I wrote vi. I think the redisplay module of the editor is almost intractable. It does a really good job for what it does, but when you're writing programs as you're learning... That's why I stopped working on it. What actually happened was that I was in the process of adding multiwindows to vi when we installed our
VAX VAX (an acronym for Virtual Address eXtension) is a series of computers featuring a 32-bit instruction set architecture (ISA) and virtual memory that was developed and sold by Digital Equipment Corporation (DEC) in the late 20th century. The VA ...
, which would have been in December of '78. We didn't have any backups and the tape drive broke. I continued to work even without being able to do backups. And then the source code got scrunched and I didn't have a complete listing. I had almost rewritten all of the display code for windows, and that was when I gave up. After that, I went back to the previous version and just documented the code, finished the manual and closed it off. If that scrunch had not happened, vi would have multiple windows, and I might have put in some programmability—but I don't know. The fundamental problem with vi is that it doesn't have a mouse and therefore you've got all these commands. In some sense, it's backwards from the kind of thing you'd get from a mouse-oriented thing. I think multiple levels of undo would be wonderful, too. But fundamentally, vi is still ed inside. You can't really fool it. It's like one of those pinatas—things that have candy inside but has layer after layer of paper mache on top. It doesn't really have a unified concept. I think if I were going to go back—I wouldn't go back, but start over again.
In 1979,
Mary Ann Horton Mary Ann Horton (born Mark R. Horton, on November 21, 1955), is a Usenet and Internet pioneer. Horton contributed to Berkeley UNIX (BSD), including the vi editor and terminfo database, (see Acknowlegments section at end of file) created the firs ...
took on responsibility for vi. Horton added support for arrow and function keys, macros, and improved performance by replacing
termcap Termcap (''terminal capability'') is a software library and database used on Unix-like computers. It enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text m ...
with
terminfo Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. Mary Ann Horton implemented the first terminfo library in 1981–1982 as an improvement over termcap. The improvements include * fast ...
. (see Acknowledgments section at end of file)


Ports and clones

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 Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, the ...
, and AT&T's
UNIX System V Unix System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, an ...
(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 Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
,
HP-UX HP-UX (from "Hewlett Packard Unix") is Hewlett Packard Enterprise's proprietary implementation of the Unix operating system, based on Unix System V (initially System III) and first released in 1984. Current versions support HPE Integrity Ser ...
,
Tru64 UNIX Tru64 UNIX is a discontinued 64-bit UNIX operating system for the Alpha instruction set architecture (ISA), currently owned by Hewlett-Packard (HP). Previously, Tru64 UNIX was a product of Compaq, and before that, Digital Equipment Corporation ( ...
, and
AIX Aix or AIX may refer to: Computing * AIX, a line of IBM computer operating systems *An Alternate Index, for a Virtual Storage Access Method Key Sequenced Data Set *Athens Internet Exchange, a European Internet exchange point Places Belgium ...
, continued 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. In 1983, vi was one of several UNIX tools available for Charles River Data Systems'
UNOS The United Network for Organ Sharing (UNOS) is a non-profit, scientific and educational organization that administers the only Organ Procurement and Transplantation Network (OPTN) in the United States, established () by the U.S. Congress in 1984 b ...
operating system under
Bell Laboratories Nokia Bell Labs, originally named Bell Telephone Laboratories (1925–1984), then AT&T Bell Laboratories (1984–1996) and Bell Labs Innovations (1996–2007), is an American industrial research and scientific development company owned by mult ...
license. While commercial vendors could work with Bill Joy's codebase, many people could not. Because Joy had begun with
Ken Thompson Kenneth Lane Thompson (born February 4, 1943) is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B programmi ...
's ed editor, ex and vi were derivative works and could not be distributed except to people who had an AT&T source license. Those wanting a free Unix-style editor would have to look elsewhere. By 1985, a version of
Emacs Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
( 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 for the
Atari ST The Atari ST is a line of personal computers from Atari Corporation and the successor to the Atari 8-bit family. The initial model, the Atari 520ST, had limited release in April–June 1985 and was widely available in July. It was the first pers ...
. In early January 1990, Steve Kirkendall posted a new clone of vi, ''
Elvis Elvis Aaron Presley (January 8, 1935 – August 16, 1977), or simply Elvis, was an American singer and actor. Dubbed the "Honorific nicknames in popular music, King of Rock and Roll", he is regarded as Cultural impact of Elvis Presley, one ...
'', to the
Usenet Usenet () is a worldwide distributed discussion system available on computers. It was developed from the general-purpose Unix-to-Unix Copy (UUCP) dial-up network architecture. Tom Truscott and Jim Ellis conceived the idea in 1979, and it was ...
newsgroup comp.os.minix, aiming for a more complete and more faithful clone of vi than STEVIE. (discusses January comp.os.minix posting, and design goals) It quickly attracted considerable interest in a number of enthusiast communities.
Andrew Tanenbaum Andrew Stuart Tanenbaum (born March 16, 1944), sometimes referred to by the handle ast, is an American-Dutch computer scientist and professor emeritus of computer science at the Vrije Universiteit Amsterdam in the Netherlands. He is the author ...
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 Lynne Greer Jolitz (born June 30, 1961) is a figure in free software and founder of many startups in Silicon Valley. Together with her husband William, she created 386BSD, the first open-source Unix-based operating system for personal computer ...
and
William Jolitz William Frederick Jolitz (February 22, 1957 – March 2, 2022), commonly known as Bill Jolitz, was an American software engineer best known for developing the 386BSD operating system from 1989 to 1994 along with his wife Lynne Jolitz. Before 3 ...
began porting
BSD Unix The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
to run on
386 __NOTOC__ Year 386 ( CCCLXXXVI) was a common year starting on Thursday (link will display the full calendar) of the Julian calendar. At the time, it was known as the Year of the Consulship of Honorius and Euodius (or, less frequently, year 113 ...
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 386BSD (also known as "Jolix") is a discontinued Unix operating system based on the Berkeley Software Distribution (BSD). It was released in 1992 and ran on PC-compatible computer systems based on the 32-bit Intel 80386 microprocessor. 386BSD inn ...
distribution adopted Elvis. 386BSD's descendants,
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
and
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is a ...
, followed suit. But at UC Berkeley, Keith Bostic wanted a "bug for bug compatible" replacement for Joy's vi for 4.4BSD-Lite. Using Kirkendall's Elvis (version 1.8) as a starting point, Bostic created
nvi NVI or nvi may refer to: * nvi, a text editor * Avial NV, an airline * ''no value indicator'', a non-denominated postage stamp * Navoiy Airport, in Uzbekistan * Negative volume index, a financial analysis method * ''Nationale Vliegtuig Industrie'' ...
, 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 feature sets, 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. 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 provided a number of enhancements over traditional vi, and dropped some of its legacy features (such as open mode for editing one line at a time). Thus 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.


Impact

Over the years since its creation, vi became the ''de facto'' standard
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
editor and a
hacker A hacker is a person skilled in information technology who uses their technical knowledge to achieve a goal or overcome an obstacle, within a computerized system by non-standard means. Though the term ''hacker'' has become associated in popu ...
favorite outside of
MIT The Massachusetts Institute of Technology (MIT) is a private land-grant research university in Cambridge, Massachusetts. Established in 1861, MIT has played a key role in the development of modern technology and science, and is one of the mo ...
until the rise of
Emacs Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
after about 1984. The Single UNIX Specification specifies vi, so every conforming system must have it. vi is still widely used by users of the Unix family of operating systems. About half the respondents in a 1991
USENET Usenet () is a worldwide distributed discussion system available on computers. It was developed from the general-purpose Unix-to-Unix Copy (UUCP) dial-up network architecture. Tom Truscott and Jim Ellis conceived the idea in 1979, and it was ...
poll preferred vi. In 1999,
Tim O'Reilly Tim O'Reilly (born 6 June 1954) is the founder of O'Reilly Media (formerly O'Reilly & Associates). He popularised the terms open source and Web 2.0. Education and early life Born in County Cork, Ireland, Tim O'Reilly moved to San Francisco, C ...
, founder of the eponymous computer book publishing company, stated that his company sold more copies of its vi book than its Emacs book.


Interface

vi is a modal editor: it operates in either ''insert mode'' (where typed text becomes part of the document) or ''command mode'' (where keystrokes are interpreted as commands that control the edit session). For example, typing while in command mode switches the editor to insert mode, but typing again at this point places an "i" character in the document. From insert mode, pressing switches the editor back to command mode. A perceived advantage of vi's separation of text entry and command modes is that both text editing and command operations can be performed without requiring the removal of the user's hands from the
home row Touch typing (also called blind typing, or touch keyboarding) is a style of typing. Although the phrase refers to typing without using the sense of sight to find the keys—specifically, a touch typist will know their location on the keyboard thro ...
. As non-modal editors usually have to reserve all keys with letters and symbols for the printing of characters, any special commands for actions other than adding text to the buffer must be assigned to keys that do not produce characters, such as function keys, or combinations of modifier keys such as , and with regular keys. Vi has the property that most ordinary keys are connected to some kind of command for positioning, altering text, searching and so forth, either singly or in key combinations. Many commands can be touch typed without the use of or . Other types of editors generally require the user to move their hands from the home row when
touch typing Touch typing (also called blind typing, or touch keyboarding) is a style of typing. Although the phrase refers to typing without using the sense of sight to find the keys—specifically, a touch typist will know their location on the keyboard thro ...
: * To use a mouse to select text, commands, or menu items in a
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
editor. * To the arrow keys or editing functions (Home / End or
Function Keys A function key is a key on a computer or terminal keyboard that can be programmed so as to cause an operating system command interpreter or application program to perform certain actions, a form of soft key. On some keyboards/computers, function ...
). * To invoke commands using modifier keys in conjunction with the standard typewriter keys. For instance, in vi, replacing a word is ''replacement text'', which is a combination of two independent commands (change and word-motion) together with a transition into and out of insert mode. Text between the cursor position and the end of the word is overwritten by the replacement text. The operation can be repeated at some other location by typing , the effect being that the word starting at that location will be replaced with the same replacement text. A
human–computer interaction Human–computer interaction (HCI) is research in the design and the use of computer technology, which focuses on the interfaces between people (users) and computers. HCI researchers observe the ways humans interact with computers and design tec ...
textbook notes on its first page that "One of the classic UI foibles—told and re-told by HCI educators around the world—is the vi editor's lack of feedback when switching between modes. Many a user made the mistake of providing input while in command mode or entering a command while in input mode."


Contemporary derivatives and clones

* Vim "Vi IMproved" has many additional features compared to vi, including (scriptable)
syntax highlighting Syntax highlighting is a feature of text editors that are used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of terms ...
, mouse support, graphical versions, visual mode, many new editing commands and a large amount of extension in the area of ex commands. Vim is included with almost every Linux distribution (and is also shipped with every copy of
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
). Vim also has a vi compatibility mode, in which Vim is more compatible with vi than it would be otherwise, although some vi features, such as open mode, are missing in Vim, even in compatibility mode. This mode is controlled by the option. It is automatically turned on by Vim when it is started in a situation that looks as if the software might be expected to be vi compatible. Vim features that do not conflict with vi compatibility are always available, regardless of the setting. Vim was derived from a port of STEVIE to the
Amiga Amiga is a family of personal computers introduced by Commodore in 1985. The original model is one of a number of mid-1980s computers with 16- or 32-bit processors, 256 KB or more of RAM, mouse-based GUIs, and significantly improved graphi ...
. *
Elvis Elvis Aaron Presley (January 8, 1935 – August 16, 1977), or simply Elvis, was an American singer and actor. Dubbed the "Honorific nicknames in popular music, King of Rock and Roll", he is regarded as Cultural impact of Elvis Presley, one ...
is a free vi clone for Unix and other operating systems written by Steve Kirkendall. Elvis introduced a number of features now present in other vi clones, including allowing the cursor keys to work in input mode. It was the first to provide color syntax highlighting (and to generalize syntax highlighting to multiple filetypes). Elvis 1.x was used as the starting point for
nvi NVI or nvi may refer to: * nvi, a text editor * Avial NV, an airline * ''no value indicator'', a non-denominated postage stamp * Navoiy Airport, in Uzbekistan * Negative volume index, a financial analysis method * ''Nationale Vliegtuig Industrie'' ...
, but Elvis 2.0 added numerous features, including multiple buffers, windows, display modes, and file access schemes. Elvis is the standard version of vi shipped on
Slackware Linux Slackware is a Linux distribution created by Patrick Volkerding in 1993. Originally based on Softlanding Linux System, Slackware has been the basis for many other Linux distributions, most notably the first versions of SUSE Linux distributions ...
, Kate OS, and MINIX. The most recent version of Elvis is 2.2, released in October 2003. *
nvi NVI or nvi may refer to: * nvi, a text editor * Avial NV, an airline * ''no value indicator'', a non-denominated postage stamp * Navoiy Airport, in Uzbekistan * Negative volume index, a financial analysis method * ''Nationale Vliegtuig Industrie'' ...
is an implementation of the ex/vi text editor originally distributed as part of the final official Berkeley Software Distribution (4.4 BSD-Lite). This is the version of vi that is shipped with all BSD-based open source distributions. It adds command history and editing, filename completions, multiple edit buffers, and multi-windowing (including multiple windows on the same edit buffer). Beyond 1.79, from October, 1996, which is the recommended stable version, there have been "development releases" of nvi, the most recent of which is 1.81.6, from November, 2007. * vile was initially derived from an early version of Microemacs in an attempt to bring the
Emacs Emacs , originally named EMACS (an acronym for "Editor MACroS"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
multi-window/multi-buffer editing paradigm to vi users, and was first published on
Usenet Usenet () is a worldwide distributed discussion system available on computers. It was developed from the general-purpose Unix-to-Unix Copy (UUCP) dial-up network architecture. Tom Truscott and Jim Ellis conceived the idea in 1979, and it was ...
's alt.sources in 1991. It provides infinite undo, UTF-8 compatibility, multi-window/multi-buffer operation, a macro expansion language, syntax highlighting, file read and write hooks, and more. *
BusyBox BusyBox is a software suite that provides several Unix utilities in a single executable file. It runs in a variety of POSIX environments such as Linux, Android, and FreeBSD, although many of the tools it provides are designed to work with in ...
, a set of standard Linux utilities in a single executable, includes a tiny vi clone. *
Neovim Vim (;
"Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a capital, since it's a name, again like Jim."
, a refactor of Vim, which it strives to supersede.


See also

*
List of text editors The following is a list of notable text editors. Graphical and text user interface The following editors can either be used with a graphical user interface or a text user interface. Graphical user interface Text user interface Sys ...
*
Comparison of text editors This article provides basic comparisons for notable text editors. More feature details for text editors are available from the '':Text editor features, Category of text editor features'' and from the individual products' articles. This article may ...
*
visudo sudo ( or ) is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do", as that was all it did, and it i ...
*
List of Unix commands This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of G ...


References


Further reading

* *


External links


The Traditional Vi: Source Code for Modern Unix Systems


by Mark Horton and Bill Joy



* ttps://github.com/n-t-roff?tab=repositories The original source code of ex (aka vi) versions 1.1, 2.2, 3.2, 3.6, and 3.7 ported to current UNIX {{Authority control Computer-related introductions in 1976 Free text editors Software using the BSD license Unix SUS2008 utilities Unix text editors Console applications