vi (usually, /usr/bin/vi or /usr/ucb/vi) is a text editor on Unix systems. To be exact, it is an editor mode ('visual mode', hence the name) added to the standard Unix editor ex.

vi was written in 1976 by the 17-year old Berkeley undergraduate Bill Joy and added to Berkeley's local copy of the Unix OS source, the BSD Unix distribution.

ex, an extended version of the basic ed editor, is line oriented, which is the best you can do if your output device is a line printer; vi is screen oriented, showing a whole screenful of text at a time, with cursor-based navigation and operations. A logical step if you want to take advantage of the capabilities of terminals such as DEC's vt100.

vi's user interface was designed to minimize typing. Commands are single, mostly lowercase characters; arguments to commands, usually to indicate a position or range in the file, are often single characters as well, and follow the command. As a special case - to minimise typing further - the current line is indicated by duplication. For example, d is the deletion command; dd deletes the current line, d{ deletes to the start of the current paragraph, dG deletes to the end of this file.

The brevity of its commands makes them hard to memorise, and the relative lack of visual feedback makes them hard to use. You have to do it right the first time, and you have to do it all by heart. This is a problem for everyone but a 17-year old computer whizkid, which explains vi's bad reputation.

Another bad problem with vi and ex is the fact that its interface is modal: to insert characters you go into input mode, and to issue commands again, you have to leave it first. This often results in commands being added to the text, or worse, in long sequences of commands being issued that vi will happily execute without the user even knowing what they mean.

However, vi/ex is the only universally available editor on Unix-like systems, so if you switch systems a lot, a working knowledge of vi really helps to get basic editing done.

It must be added that many vi-likes have developed, such as nvi, elvis, and the most popular and most bloated one, vim. These are vi compatible as far as common commands go, but add many new commands and features of their own. vim even has a menu interface.

I once even ran into a system (a halfway installed Debian distribution, years ago) that managed to install as /usr/bin/vi an editor (ae) that is not vi at all. This of course spoils the idea that wherever you go, there will always be the dreadful vi to help you get by. It is also the reason I've never used Debian.