On Tue, 06 Mar 2007 15:45:48 -0600, Tim Chase <[EMAIL PROTECTED]> wrote:
> Multi-character mappings also have a slight delay in them, so in > the preceeding example, after I type "HELI", there's a slight > pause while Vim sees if I am going to type "U", or if I type > something else, so it knows how to behave. > > Things get slightly more complex if you're writing code-block > expansions such as wanting "IF" to expand to > > if (|) { > } else { > } > > and put the cursor where the "|" is. It involves an expansion > (and thus suggests an :iab for the expansion) but also involves > moving the cursor to a particular position. I've not had luck > doing those as :iab expansions, so I resort to mappings...usually > prefixing them with an infrequently used character such as > control+G or a tilde as fits. Abbreviations don't have the delay that mappings do, but they do mean that Vim must wait until the character after the abbreviation has been typed so it can distinguish between "IF " and "IFFY", only expanding the abbreviation in the first case. I've never made much use of abbreviations. I did try using them back when I first started using vi but I found that I had to choose arcane abbreviation sequences in order to avoid expansions when I didn't want them, and it eventually dawned on me that it was taking me longer to recall the correct abbreviation than it would have taken to type out the abbreviated phrase in full. So now I mainly use maps and function keys for insert-time replacements. One situation in which abbreviations work well is if you're writing text and the house style is to write (say) "National Aeronautics and Space Administration" in full rather than "NASA". They're also useful for fixing common typing errors: I often type "adminsitration" because after being left out of the action for three letters my left hand gets impatient and bounces off the s early to give it more time to head t-wards, so an abbreviation to replace that with what I intended to type is useful. -- Matthew Winn