Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Vi (text editor)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== ===Creation=== [[File:Bill Joy at World Economic Forum (Davos), 2003-01 (cropped).jpg|thumb|[[Bill Joy]], the original creator of the vi editor in 2003]] vi was derived from a sequence of UNIX command line editors, starting with [[Ed (text editor)|ed]], which was a line editor designed to work well on [[teleprinter]]s, rather than [[computer terminal|display terminals]]. Within [[AT&T Corporation]], where ed originated, people seemed to be happy with an editor as basic and unfriendly as ed, [[George Coulouris (computer scientist)|George Coulouris]] recalls:<ref name=coulouris/> <blockquote> [...] for many years, they had no suitable terminals. They carried on with [[teleprinter|TTY]]s and other printing terminals for a long time, and when they did buy screens for everyone, they got [[Tektronix 4014]]s. These were large [[direct-view bistable storage tube|storage tube]] 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. </blockquote> 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"<ref name="em-source">{{cite web |title=Source code for em |date=February 1976 |work=coulouris.net |url=https://www.coulouris.net/cs_history/em_story/emsource/}}</ref>) while acting as a lecturer at [[Queen Mary, University of London|Queen Mary College]].<ref name=coulouris>''A Quarter Century of UNIX'', by Peter H. Salus, Addison-Wesley 1994, pages 139–142. [https://www.coulouris.net/cs_history/em_story/ (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 [[University of California, Berkeley|UC Berkeley]] in the summer of 1976, he brought a [[DECtape]] 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]], were impressed.<ref name=coulouris/> Inspired by em, and by their own tweaks to ed,<ref name="interview"/> [[Bill Joy]] and Chuck Haley, both graduate students at [[University of California, Berkeley|UC Berkeley]], took code from em to make en,<ref name="interview"/><ref name=register>{{cite web |last=Vance |first=Ashlee |author-link=Ashlee Vance |title=Bill Joy's greatest gift to man – the vi editor |work=[[The Register]] |date=11 September 2003 |url=https://www.theregister.co.uk/2003/09/11/bill_joys_greatest_gift/ |access-date=2012-06-30 |url-status=dead |archive-url=https://web.archive.org/web/20120513104857/http://www.theregister.co.uk/2003/09/11/bill_joys_greatest_gift/ |archive-date=13 May 2012}}</ref> and then "extended" en to create [[Ex (text editor)|ex]] version 0.1.<ref name="interview"/> After Haley's departure, Bruce Englar encouraged Joy to redesign the editor,<ref name="ex-Acks-bsd4.4">{{cite manual |title=ex Reference Manual |series=4.4 BSD (encumbered, not Lite) |last=Joy |first=Bill |publisher=CSRG, UC Berkeley |format=roff source |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/src/usr.bin/ex/USD.doc/ex/ex.rm}} (see Acknowledgments section at end of file)</ref> which he did June through October 1977 adding a full-screen visual mode to ex<ref name="ex-date">{{cite web |title=See dates in copyright headers, ex 1.1 source code |work=minnie.tuhs.org |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=1BSD/ex-1.1}}</ref>{{emdash}}which came to be vi.<ref name="begriff">{{cite web |title=History and effective use of Vim |website=begriffs.com |url=https://begriffs.com/posts/2019-07-19-history-use-vim.html#history |access-date=2021-08-27}}</ref> vi and ex share their code; vi is the ex [[executable|binary]] launching with the capability to render the text being edited onto a [[computer terminal]]{{emdash}}it is ex's visual mode.<ref name="begriff"/> The name ''vi'' comes from the abbreviated ex command (<code>vi</code>) to enter the visual mode from within it. The longform command to do the same was <code>visual</code>,<ref name="begriff"/><ref name="exman">{{cite manual |last=Joy |first=William N. |author-link=Bill Joy |orig-date=November 1977 |title=Ex Reference Manual Version 1.1 |date=November 1977 |chapter=Command summary |location=Berkeley, CA |page=8 |url=https://begriffs.com/pdf/ex-manual.pdf |url-status=live |archive-url=https://web.archive.org/web/20200414143456/https://begriffs.com/pdf/ex-manual.pdf |archive-date=14 April 2020}}</ref> and the name ''vi'' is explained as a contraction of ''visual'' in later literature. <code>vi</code> is also the [[command (computing)|shell command]] to launch ex/vi in the visual mode directly, from within a [[shell (computing)|shell]].<ref name="begriff"/> According to Joy, many of the ideas in this visual mode were taken from [[Bravo (editor)|Bravo]]{{emdash}}the bimodal text editor developed at [[Xerox PARC]] for the [[Xerox Alto|Alto]]. In an interview about vi's origins, Joy said:<ref name="interview"/> <blockquote> 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 (text editor)|ed]]—we got a manual page for the Toronto version of ed, which I think [[Rob Pike]] had something to do with. We took some of the regular expression extensions out of that. </blockquote> [[File:KB Terminal ADM3A.svg|thumb|upright=2|right|[[ADM-3A]] terminal keyboard layout]] Joy used a [[Lear Siegler]] [[ADM-3A]] terminal. On this terminal, the [[Escape key]] was at the location now occupied by the [[Tab key]] on the widely used [[IBM PC keyboard]] (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 [[arrow keys#HJKL keys|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 [[baud rate|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.<ref name=register/> ===Distribution=== Joy was responsible for creating the first [[BSD Unix]] release in March, 1978, and included ex 1.1 (dated 1 February 1978)<ref name="v1.1-version">{{cite web |title=version.c, ex 1.1 source code |work=minnie.tuhs.org |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=1BSD/ex-1.1/Version.c}}</ref> in the distribution, thereby exposing his editor to an audience beyond [[University of California, Berkeley|UC Berkeley]].<ref name="1bsd-READ_ME">{{cite web |title=1BSD/READ_ME |format=roff source |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=1BSD/READ_ME}} Formatted: {{cite web |title=Berkeley UNIX Software Tape |url=http://www.skytel.co.cr/bsd/research/acrobat/780201.pdf |access-date=27 December 2010 |url-status=dead |archive-url=https://web.archive.org/web/20110718162521/http://www.skytel.co.cr/bsd/research/acrobat/780201.pdf |archive-date=18 July 2011}}</ref> From that release of [[Berkeley Software Distribution|BSD Unix]] 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]], could cost hundreds of dollars.<ref name="interview"/> Eventually it was observed that most ex users were spending all their time in visual mode,{{Citation needed|date=November 2008}} and thus in ex 2.0 (released as part of Second Berkeley Software Distribution in May, 1979), Joy created vi as a [[hard link]] to ex,<ref name="v2-makefile">{{cite web |title=makefile, ex 2.0 source code |work=minnie.tuhs.org |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=2BSD/src/ex/makefile}}</ref> 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#Models|PDP-11/70]],<ref name="ex2.0-READ_ME">{{cite web |title=READ_ME |work=ex 2.0 source code |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=2BSD/src/ex/READ_ME}}</ref> 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;<ref name="ex3.1-READ_ME">{{cite web |title=ex 3.1 source code |url=http://minnie.tuhs.org/cgi-bin/utree.pl?file=3bsd/usr/src/cmd/ex/READ_ME}}</ref> the editor would be also too big to run on [[PC/IX]] for the [[IBM PC]] in 1984.<ref name="iw19840402">{{cite news |title=A First Look at PC-IX |work=InfoWorld |date=1984-04-02 |author1=McMahon, Marilyn |author2=Putnam, Robert |pages=39–42 |url=https://books.google.com/books?id=kC4EAAAAMBAJ&pg=PA40 |access-date=25 February 2016}}</ref> Joy continued to be lead developer for vi until version 2.7 in June 1979,<ref name="ex-Acks-bsd4.4"/><ref name="vi-versions"/> and made occasional contributions to vi's development until at least version 3.5 in August 1980.<ref name="vi-versions">{{cite web |title=Change log for vi, versions 2.1–3.7 |work=minnie.tuhs.org |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/src/ucb/ex/ex.news}}</ref> In discussing the origins of vi and why he discontinued development, Joy said:<ref name="interview"/> <blockquote> 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 (user interface)|mode]]-based editor. I think as mode-based editors go, it's pretty good. One of the good things about [[Emacs|EMACS]], 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]], 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. </blockquote> In 1979,<ref name="interview"/> [[Mary Ann Horton]] took on responsibility for vi. Horton added support for arrow and function keys, macros, and improved performance by replacing [[termcap]] with [[terminfo]].<ref name="ex-Acks-bsd4.4"/><ref name="vi-Acks-bsd4.4">{{cite manual |title=vi Reference Manual |series=4.4 BSD (encumbered, not Lite) |last=Joy |first=Bill |publisher=CSRG, UC Berkeley |format=roff source |url=https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/src/usr.bin/ex/USD.doc/vi/vi.in}} (see Acknowledgments section at end of file)</ref> ===Ports and clones=== [[File:OpenBSD vi Editor.png|thumb|The vi editor in [[OpenBSD]] (''[[nvi]]'') on startup, editing a temporary empty file]] [[File:OpenBSD vi Editor Ruby Hello World.png|thumb|The vi editor in [[OpenBSD]], editing a small [[Hello world program|"Hello, world!"]] type [[Ruby (programming language)|Ruby]] program]] Up to version 3.7 of vi, created in October 1981,<ref name="vi-versions"/> 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,<ref>{{cite book |title=UNIX: the complete reference |year=2006 |publisher=McGraw-Hill Osborne Media |isbn=978-0-07-226336-7 |author=Kenneth H. Rosen |author2=Douglas A. Host |author3=Rachel Klee |page=10 |url=https://books.google.com/books?id=2Et--84HIkwC&pg=PA10}}</ref> 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, [[Hewlett-Packard|HP]], [[Digital Equipment Corporation|DEC]], and [[IBM]] each received copies of the vi source, and their operating systems, [[Solaris (operating system)|Solaris]], [[HP-UX]], [[Tru64 UNIX]], and [[AIX]], 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 (operating system)|UNOS]] operating system under [[Bell Laboratories]] license.<ref>{{Cite book|year=1983|title=The Insider's Guide To The Universe|publisher=Charles River Data Systems, Inc.|url=https://www.1000bit.it/ad/bro/charles/CharlesRiverSystem-Universe.pdf|page=13}}</ref> While commercial vendors could work with Bill Joy's codebase, many people could not. Because Joy had begun with [[Ken Thompson]]'s [[Ed (text editor)|ed]] editor, ex and vi were derivative works and could not be distributed except to people who had an AT&T source license.{{Citation needed|date=July 2023}} Those wanting 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 (text editor)|STEVIE]] (ST Editor for VI Enthusiasts), a limited vi clone, appeared for the [[Atari ST]].<ref name=stevie>{{cite web |last=Thompson |first=Tim |date=26 March 2000 |title=Stevie |url=https://timthompson.com/tjt/stevie/ |access-date=2010-12-29}}</ref><ref name="stevie-usenet">{{cite newsgroup |title=A mini-vi for the ST |author=Tim Thompson |date=28 June 1987 |newsgroup=comp.sys.atari.st |message-id=129@glimmer.UUCP |url=https://groups.google.com/g/comp.sys.atari.st/c/J65TpLBhfss/m/Mop3jYhvuY0J |access-date=2010-12-29}}</ref> In early January 1990, Steve Kirkendall posted a new clone of vi, ''[[Elvis (text editor)|Elvis]]'', to the [[Usenet]] newsgroup comp.os.minix, aiming for a more complete and more faithful clone of vi than STEVIE.<ref name="elvis-Kirkendall">{{cite newsgroup |title=A new clone of vi is coming soon: ELVIS |author=Steve Kirkendall |date=20 April 1990 |newsgroup=comp.editors |message-id=2719@psueea.UUCP |url=https://groups.google.com/g/comp.editors/c/rdUYDzANsMw/m/ErR-8j1VCfQJ |access-date=2010-12-29}} (discusses January comp.os.minix posting, and design goals)</ref> It quickly attracted considerable interest in a number of enthusiast communities.<ref>Usenet, various newsgroups (comp.editors, comp.sys.*, comp.os.*), 1990</ref> [[Andrew S. Tanenbaum|Andrew Tanenbaum]] quickly asked the community to decide on one of these two editors to be the vi clone in [[Minix]];<ref name="elvis-Tanenbaum">{{cite newsgroup |title=Elvis vs. stevie |author=Andrew S. Tanenbaum |date=18 January 1990 |newsgroup=comp.os.minix |message-id=5133@ast.cs.vu.nl |url=https://groups.google.com/g/comp.os.minix/c/RhqVtXMWiN8/m/6GlQiUR7aeYJ |access-date=2010-12-29}}</ref> 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 [[Intel 80386|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. 386BSD's descendants, [[FreeBSD]] and [[NetBSD]], followed suit. But at UC Berkeley, [[Keith Bostic (software engineer)|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]], releasing it in the northern spring of 1994.<ref name="nvi-chapter"/> When FreeBSD and NetBSD resynchronized the 4.4-Lite2 codebase, they too switched over to Bostic's nvi, which they continue to use today.<ref name="nvi-chapter"/> Despite the existence of vi clones with enhanced feature sets, sometime before June 2000,<ref>[http://ex-vi.cvs.sourceforge.net/viewvc/ex-vi/ex-vi/Changes?view=markup Changes] file, from Traditional Vi by Gunnar Ritter</ref> 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,<ref>{{cite web |title=Caldera License for 32-bit 32V UNIX and 16 bit UNIX Versions 1, 2, 3, 4, 5, 6, 7 |work=mckusick.com |url=https://www.mckusick.com/csrg/calder-lic.pdf}}</ref> 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.<ref>{{cite web |date=2013-03-07 |title=The traditional vi |website=SourceForge |url=https://sourceforge.net/projects/ex-vi/ |access-date=2023-07-24}}</ref> 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 [[list of Unix systems#Commercial AT&T UNIX Systems and descendants|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]] editor and a [[hacker (programmer subculture)|hacker]] favorite outside of [[Massachusetts Institute of Technology|MIT]] until the rise of [[Emacs]] after about 1984.<ref>{{cite web |last1=Smith |first1=T. J. |title=EMACS vs. vi: The endless geek 'holy war' |website=Linux.com |date=4 December 2001 |url=https://www.linux.com/news/emacs-vs-vi-endless-geek-holy-war/ |access-date=30 January 2018}}</ref> 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]] poll preferred vi.<ref name="hackers">{{cite book |editor-last=Raymond |editor-first=Eric S. |editor-link=Eric S. Raymond |year=1996 |title=The New Hacker's Dictionary |publisher=MIT Press |edition=3rd |isbn=0-262-68092-0}}</ref> In 1999, [[Tim O'Reilly]], founder of the eponymous computer book publishing company, stated that his company sold more copies of its vi book than its Emacs book.<ref>{{cite web |title=Ask Tim Archive |publisher=O'Reilly |date=21 June 1999 |url=http://www.oreilly.com/pub/a/oreilly/ask_tim/1999/unix_editor.html}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Vi (text editor)
(section)
Add topic