Sunday, October 24, 2010

Toggle off "end-id" type of abbreviation in Vim (insert mode)

I use Vim primarily for general journaling, editing, and typesetting
(via Context or Latex) and was hoping to speed up my typing with a
typed shorthand scheme as described at http://www.eskimo.com/~oak/abr/
(or search for `mnemologistics abbreviations vim' to avoid having to
click directly on the link).

For instance, I would include the following lines in a source file run
by .vimrc:
ia t the
ia T The

ia Xt t "In case I need to use a literal `t'
ia xT T

This often works well, but there are times when, because Vim is also
looking for abbreviations of the "end-id" type, it won't expand the
abbreviation as I'd like. For example,
T cat goes to t store.
expands as desired to
The cat goes to the store.
but
She said, ``T cat goes to t store.''
expands to
She said, ``T cat goes to the store.''
Since Vim sees ``T as a valid potential abbreviation, it politely
declines to expand it to ``The. Is there a way to disable the "end-id"
type of abbreviation so that Vim will no longer see ``T as a valid
abbreviation and will go ahead and expand it to ``The?

Because of how the "end-id" type of abbreviation is defined, this
problem doesn't exist for two-letter abbreviations, and I can still
use them (e.g. aa for always, bc for because). The single letter
abbreviations offer some of the greatest advantage in typing speed,
though, since many frequently used words are very short. (And I think
it would slow my typing down if I had to be constantly going back and
correcting whenever I noticed that I had preceded a single-letter
abbreviation with punctuation.) And I think I could get by without
having to use any end-id abbreviations.

Thanks for any help!

Scott

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment