bug in vi with :ab

Daniel R. Levy levy at ttrdc.UUCP
Mon Jul 18 04:29:41 AEST 1988


In article <5473 at super.upenn.edu>, brant at linc.cis.upenn.edu (Brant Cheikes) writes:
# Problem: Abbreviations are expanded at all levels of vi.
# This has been reproduced in both System V vi and BSD vi
# (SVR2 and 4.3BSD respectively).
# Reproduce:  Run vi, and set an abbreviation, say :ab foo FooBaz.
# Now insert some text, anytime you type "foo", it will be replaced
# by "FooBaz".  This is fine.  However, you can no longer ever search
# for the string "foo", nor edit a file called "foo"--in all cases,
# "foo" is expanded first to FooBaz.
# SO, is this a bug?  Is there some way to search for abbreviation
# strings?  If a bug, is there a fix?  It seems to me that abbreviations
# should ONLY be expanded while in input mode.

"Bug" is in the eye of the beholder, I guess, but yes there is a way to do
what you want.  Hide one of the characters of the abbreviation (except the
first if it is a multi-character abbreviation) with a back-slash, e.g. even
if you have done ":ab foo FooBaz", /f\oo/<RETURN> searches for "foo" and
:vi f\oo<RETURN> edits file "foo" etc.
-- 
|------------Dan Levy------------|  THE OPINIONS EXPRESSED HEREIN ARE MINE ONLY
|    AT&T  Data Systems Group    |  AND ARE NOT TO BE IMPUTED TO AT&T.
|        Skokie, Illinois        | 
|-----Path:  att!ttbcad!levy-----|



More information about the Comp.bugs.4bsd.ucb-fixes mailing list