Path: utzoo!mnetor!uunet!mcvax!ukc!its63b!aiva!ken
From: ken@aiva.ed.ac.uk (Ken Johnson)
Newsgroups: comp.editors
Subject: Re: Query-replace on VI
Message-ID: <408@aiva.ed.ac.uk>
Date: 9 May 88 16:17:36 GMT
References: <2587@geac.UUCP> <27909@yale-celray.yale.UUCP> <86@skep2.ATT.COM> <393@aiva.ed.ac.uk> <52205@sun.uucp>
Reply-To: ken@uk.ac.ed.aiva (Ken Johnson,E32 SB x212E)
Followup-To: comp.editors
Organization: Dept. of AI, Univ. of Edinburgh, UK
Lines: 23
Keywords: sorry
Summary: You are all right

>>>>  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.
>
>Ken, look at the command more carefully. That trailing "c" tells vi to
>ask the user about each replacement. Sounds amazingly like how EMACS
>handles "query-replace".

You are all right -- it is a query replace. I didn't notice the
little `c' at the end. I looked in both the Vi manual and the Ex
manual, and then posted my own note. In future I will try to check
my brain is engaged before operating my mouth.

-- Ken
-- 
------------------------------------------------------------------------------
From Ken Johnson, AI Applications Institute, The University, EDINBURGH
Phone 031-225 4464 ext 212
Email k.johnson@ed.ac.uk