Xref: utzoo comp.bugs.sys5:484 comp.bugs.4bsd:854 Path: utzoo!attcan!uunet!mcvax!tuvie!mssx!andy From: andy@mssx.UUCP (Andreas Pleschutznig) Newsgroups: comp.bugs.sys5,comp.bugs.4bsd Subject: Re: bug in vi with :ab Summary: How to deal with the :ab 'bug' in vi Message-ID: <673@mssx.UUCP> Date: 22 Jul 88 12:47:12 GMT References: <5473@super.upenn.edu> Organization: Micro Systems Software, Graz Lines: 35 In article 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. > -- Well, I don't think this is really a bug in vi, because if you read the description of your system carefully, you will notice that there are certain char's like '\' to take the special meaning off. Just try the following vi test :ab x foo x x x You will notice, that the 'x' is translated to 'foo'. Now go up and do 'rx' at a pace you wish to -> Hmmm... The 'x' seems to be in the file without translation !!!. In the same way, you may edit then a file named 'x' by doing a line like ':e! \x', where the '\' takes off the special meaning of 'x'. Hope that helps. andy