30.31 vi Word Abbreviation
You can define abbreviations that vi will automatically expand into the full text whenever you type the abbreviation during text-input mode. To define an abbreviation, use the ex command:
abbr is an abbreviation for the specified phrase . The sequence of characters that make up the abbreviation will be expanded during text-input mode only if you type it as a full word; abbr will not be expanded within a word. [I abbreviate Covnex to Convex , my company's name, because I have dyslexic fingers. -TC ]
Suppose you want to enter text that contains a phrase that occurs frequently, such as a difficult product or company name. The command:
abbreviates the Nutshell Handbook to the initials ns . Now whenever you type ns as a separate word during text-input mode, ns expands to the full text.
Abbreviations expand as soon as you press a non-alphanumeric character (e.g., punctuation), a carriage return, or ESC (returning to command mode).  When you are choosing abbreviations, choose combinations of characters that don't ordinarily occur while you are typing text. If you create an abbreviation that ends up expanding in places where you don't want it to, you can disable the abbreviation by typing:
To list your currently defined abbreviations, type:
The characters that compose your abbreviation cannot also appear at the end of your phrase. For example, if you issue the command:
you'll get the message
you may or may not produce an infinite loop, but in either case you won't get a warning message. For example, when the above command was tested on a System V version of UNIX, the expansion worked. On a Berkeley version though, the abbreviation expanded repeatedly, like this:
the the the the the ...
until a memory error occurred and vi quit. We recommend that you avoid repeating your abbreviation as part of the defined phrase.