Xref: utzoo comp.bugs.sys5:479 comp.bugs.4bsd:845 Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!osu-cis!att!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: comp.bugs.sys5,comp.bugs.4bsd Subject: Re: bug in vi with :ab Summary: trick with backslash Message-ID: <2806@ttrdc.UUCP> Date: 17 Jul 88 18:29:41 GMT References: <5473@super.upenn.edu> Organization: AT&T, Skokie, IL Lines: 23 In article <5473@super.upenn.edu>, brant@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/searches for "foo" and :vi f\oo 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-----|