Path: utzoo!mnetor!uunet!lll-winken!csustan!polyslo!mpatnode From: mpatnode@polyslo.UUCP (Mike Patnode) Newsgroups: comp.editors Subject: Re: Query-replace on VI Message-ID: <2217@polyslo.UUCP> Date: 4 May 88 16:22:18 GMT References: <2587@geac.UUCP> <27909@yale-celray.yale.UUCP> <86@skep2.ATT.COM> <393@aiva.ed.ac.uk> Reply-To: mpatnode@polyslo.UUCP (Mike Patnode) Organization: Cal Poly State University -- San Luis Obispo Lines: 28 In article <393@aiva.ed.ac.uk> ken@uk.ac.ed.aiva (Ken Johnson,E32 SB x212E) writes: > > >>> Does anyone know if VI has the query-replace function? > >>2) :g/foo/s//BAR/gc ### works in ex-mode > >Works, but it is not a query-replace; it is a global replace. >As far as I can see there is no way to do a query-replace in `vi', >but if that is so it's a serious omission. What are you talking about? When I use the following command: :g/is/s//isn't/c On this article, I get a little line at the bottom of the screen like this: Distribution: ^^ Now if I type a y, followed by a return it will replace the occurance. Anything else followed by a return (nothing included) will skip the occurance. Try it. Now if that isn't a query-replace then what is? If your vi doesn't do this then you bought a lemon. -- Mike "Dodger" Patnode | (n) ..csustan!polyslo!mpatnode Yitbos Innovations Inc. | (s) ..sdsu!polyslo!mpatnode 244 California Blvd | mpatnode@polyslo.UUCP San Luis Obispo, Ca 92630 | (805) 541-2048 / 543-9818 / 756-2516