You can use word abbreviation with vi to insert common chunks of code, commands, or text into your documents. Simply type esc: (to go into command mode) and enter ab abbr phrase. For instance, say you were editing html, and you wanted sztt to enter standard table tags of BORDER=”0″ BGCOLOR=”#E0E0E0″ WIDTH=”99%”, you could enter:
:ab sztt BORDER="0" BGCOLOR="#E0E0E0" WIDTH="99%" |
Then, any time you enter sztt as a word, vi automatically replaces sztt with your standard table tags. Likewise, you could use abbreviations for URLs, machine names, etc. Use z or somesuch in your abbreviation, so there is no way a normal word or sequence would pop up, especially considering that variables could easily be called the same thing. Put the line in your .vimrc file so that your abbreviations are always available. To list all of your abbreviations, enter :ab.