Brian Golding wrote:
Is it possible to abbreviate multiple words.   For example to enter a
command such as

ab "by using" using

so that anytime the words "by using" are entered, they will be
replaced by just "using"?

Though Ben has already given you the "right" answer that abbreviations can't include spaces on the LHS, you might be able to hack it with a horrible mapping:

  :inoremap by<space>using using

This has the unfortunate side-effect that it thinks you're entering a mapping (and doesn't show your typed text) until you've either typed the whole thing, or you've disambiguated what you want to type. With the above, try entering

  This is done by using taxes and by usury.

you get the "This is done " portion, and then the "by usin" flickers as you type it, until you get to the "g", at which point it "expands" the mapping to just "using", and then when you start typing the "by usury", you get the "by us" flickering until the "u" disambiguates and you see the "by usu".

As stated:  an ugly hack.

When I need to flag words/phrases I prefer not to use (in my "critiqued" works, I tend to avoid forms of "to be"), I use a :match command like

  :match Error /\<\(be\|am\|is\|are\|was\|were\|...\)\>/

so they jump out at me and I can rephrase them. So in your case, I'd use

  :match Error /\<\(by using\|by \w\+ing\|...\)\>/

with any other phrases you want to revise.

-tim



-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to