home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Unix Power ToolsUnix Power ToolsSearch this book

17.25. Fixing Typos with vi Abbreviations

Abbreviations (Section 17.23) are a handy way to fix common typos. Try a few abbreviations like this:

ab teh the
ab taht that

in your .exrc (Section 17.5) file.

Any time you find yourself transposing letters or saying, "Darn, I always misspell that word," add an abbreviation to .exrc. (Of course, you do have to worry about performance if the file gets too big.)

You may be able to enforce conventions this way. For example, command names should be surrounded by <command> tags, so creating a list of abbreviations like this:

ab vi <command>vi</command>

saves us from having to type lots of SGML codes.

(Depending on your version of vi, this abbreviation may be recursive (Section 17.23) because the vi is sandwiched between other nonalphanumeric characters. nvi repeated the <command>) quite a few times and quit, but vim did what we wanted.)

--TOR and JP

Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.