views:

117

answers:

1

The abbreviation and map commands both appear to give the user redundant functionality. :imap teh the seems to get the same job done as :iabbr teh the. I tend to make all my settings in :map commands of various types- everything from typo fixes to script-like one-liners.

Is there a real difference between maps and abbreviations? Which command is best suited for which job?

+6  A: 

The biggest difference in this specific case is that iabbr will only change the text once you've pressed space, and will show each character on the screen as you type. In contrast, imap will delay the display of all characters in teh until the map has resolved one way or the other. I'd recommend iabbr in this case - you'll see characters appear as you type, words that begin with the abbreviation will be handled correctly, and (most especially) you won't get an irritating delay for all words that start with t.

Peter
space is not the only key that triggers the expansion. Any non-keyword character has the same effect.
Luc Hermitte
I see. I use the `:imap jj <esc>` and am now noticing the delay when i start any word with `j`. Is it really just a visual thing? seeing the macro in-progress vs. not seeing it?