A Brief Historical Perspective
Before diving into all the ins and outs of vi, it will help you to understand vi’s worldview of your environment. In particular, this will help you make sense of many of vi’s otherwise more obscure error messages, and also appreciate how the vi clones have evolved beyond the original vi.
vi dates back to a time when computer users worked on terminals connected via serial lines to central mini-computers. Hundreds of different kinds of terminals existed and were in use worldwide. Each one did the same kind of actions (clear the screen, move the cursor, etc.), but the commands needed to make them do these actions were different. In addition, the Unix system let you choose the characters to use for backspace, generating an interrupt signal, and other commands useful on serial terminals, such as suspending and resuming output. These facilities were (and still are) managed with the stty command.
The original UCB version of vi abstracted out the terminal control
information from the code (which was hard to change) into a text-file
database of terminal capabilities (which was easy to change),
managed by the termcap
library. In the early 1980s, System V introduced a
binary terminal information database and terminfo library. The two libraries were
largely functionally equivalent. In order to tell vi which terminal you had, you had to set
the TERM environment
variable. This was typically done in a shell startup file, such
as .profile or .login.
Today, everyone uses ...