Because editing can be repetitive, you may find yourself typing common phrases over and over again.
For example, I sing in a quartet named Town Square Harmonizers, but it is inconvenient to constantly type our name in a file.
I can avoid repeatedly typing the name if I use the
:ab command to save a sequence of text as an abbreviation, like this:
:ab tsh Town Square Harmonizers
From now on, whenever I am in text mode and I type the 'word'
tsh, vi automatically expands it to Town Square Harmonizers. I say 'word' because abbreviations are not expanded until you type them as you would a regular word--with a space or punctuation mark after the abbreviation.
The table below shows the general form of the related abbreviation commands:
1) In vi, begin the :ab command, which drops your cursor to the status line.
2) After entering the :ab command, continue editing the file. In text mode, change the word.
3) After typing tsh and then a space, the text abbreviation is triggered.
4) Return to command made by pressing Escape. Then enter :w to save your changes.
5) By using the :ab command without arguments, it lists your current abbreviations.
6) If you quit vi, you lose any abbreviations that you defined during the session.