Vi was created by Bill Joy in 1976 as an enhanced version of the line editor ed for use on video terminals rather than just printers. It added a full-screen visual mode inspired by the Bravo editor. Joy continued developing vi through 1979, adding features like macros and improved performance. However, a disk crash caused him to lose source code for a planned multi-window version, and he handed over development to others while continuing occasional contributions. Vi became very popular due to its inclusion in BSD Unix distributions.
Vi was created by Bill Joy in 1976 as an enhanced version of the line editor ed for use on video terminals rather than just printers. It added a full-screen visual mode inspired by the Bravo editor. Joy continued developing vi through 1979, adding features like macros and improved performance. However, a disk crash caused him to lose source code for a planned multi-window version, and he handed over development to others while continuing occasional contributions. Vi became very popular due to its inclusion in BSD Unix distributions.
Vi was created by Bill Joy in 1976 as an enhanced version of the line editor ed for use on video terminals rather than just printers. It added a full-screen visual mode inspired by the Bravo editor. Joy continued developing vi through 1979, adding features like macros and improved performance. However, a disk crash caused him to lose source code for a planned multi-window version, and he handed over development to others while continuing occasional contributions. Vi became very popular due to its inclusion in BSD Unix distributions.
vi was derived from a sequence of UNIX command line editors, starting with ed, which was a line editor designed to work well on teleprinters, rather than 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 recalls:[7] [...] for many years, they had no suitable terminals. They carried on with TTYs and other printing terminals for a long time, and when they did buy screens for everyone, they got Tektronix 4014s. These were large 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. 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"[8]) while acting as a lecturer at Queen Mary College.[7] 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 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.[7] Inspired by em, and by their own tweaks to ed,[2] Bill Joy and Chuck Haley, both graduate students at UC Berkeley, took code from em to make en,[2][9] and then "extended" en to create ex version 0.1.[2] After Haley's departure, Bruce Englar encouraged Joy to redesign the editor,[10] which he did June through October 1977 adding a full-screen visual mode to ex.[11] Many of the ideas in ex's visual mode (a.k.a. vi) were taken from other software that existed at the time. According to Bill Joy,[2] inspiration for vi's visual mode came from the Bravo editor, which was a bimodal editor. In an interview about vi's origins, Joy said:[2] 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 had something to do with. We took some of the regular expression extensions out of that.
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 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.[9] Distribution[edit] Joy was responsible for creating the first BSD Unix release in March, 1978, and included ex 1.1 (dated 1 February 1978)[12] in the distribution, thereby exposing his editor to an audience beyond UC Berkeley.[13] From that release of BSD Unix onwards, 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.[2] Eventually it was observed that most ex users were spending all their time in visual mode,[citation needed] 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, [14] 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,[15] 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;[16] the editor would be also too big to run on PC/IX for the IBM PC in 1984.[17] Joy continued to be lead developer for vi until version 2.7 in June 1979,[10][18] and made occasional contributions to vi's development until at least version 3.5 in August 1980.[18] In discussing the origins of vi and why he discontinued development, Joy said:[2] 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-based editor. I think as mode-based editors go, it's pretty good. One of the good things about 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, its 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,[2] Mark Horton took on responsibility for vi. Horton added support for arrow and function keys, macros, and improved performance by replacing termcap with terminfo.[10][19] Ports and clones[edit]