New to Vi?
Find out what Vi does, what Vi does not do, where Vi comes from and when to run Vi.
What does it do?
Vi (pronounced vee-eye) is a text editor. It allows you to edit files interactively and visually see the changes at the same time.
The original Vi is a modal editor consisting of two modes: normal mode and insert mode. In normal mode, keystrokes are interpreted as commands (i.e. - "j" moves down one line and "k" moves up one line). In insert mode, keystrokes are typed directly into the file being edited. Many of the text editor applications we are familiar with consist of only a single insert mode: Microsoft Word, Notepad, Wordpad, and even the email editor web applications (i.e. - Gmail).
What does it not do?
The original Vi text editor does not format the text in your files. Bold, italics, underlining, font size, font color (the list goes on) are not features of Vi. Vi does not do spell-checking. Vi does not do any syntax highlighting for programming languages like Perl, Python, etc.
As over 30 years have gone by since vi was created, many clones have been created: Stevie, Elvis, nvi and Vim, just to name a few. Many of these clones have plug-ins that support spell-check, syntax highlighting, and much more.
Where does it come from?
Vi is the visual mode of a line editor called ex.
However, it all started with ed which is a UNIX command line editor for teletypes. ed was written by Ken Thompson in 1971. In February 1976, George Coulouris modified Thompson's code and created em editor which is designed for display terminals. Bill Joy and Chuck Haley then took em, modified it to create en, and then modified that to create ex.
In October 1977, vi was born from the mind of Bill Joy. It was officially released as the visual mode of ex 1.1 in the first BSD Unix release in March 1978. Seeing the popularity of the visual mode, ex 2.0 included a short-cut to go directly to the visual mode by using the command vi.
When should you run it?
Anytime you need to edit a text file, vi can be run. For example, to edit help.txt, type: vi help.txt. Vi will launch and display the contents of help.txt.It is important to avoid the use of vi in the presence of an adamant EMACS user (especially Church of EMACS members). The possibility of being insulted, attacked or even becoming the target of an evangelistic conversion process are all within the realm of reality. In all seriousness, the vi vs. EMACS debate is an on-going rivalry that will likely have no end. Caveat emptor… 🙂
Check out some of the references below for more information about vi and its family of clones. If Vi gives you a warm fuzzy feeling, make sure to check out Vim … the de facto Vi clone these days. It even has a great support for Windows!
Wikipedia - Vi
The Vi Lovers Home Page
Wikipedia - Ed (text editor)
Vim, The Editor
An Introduction to Display Editing with Vi
Wikipedia - Editor War