Path: utzoo!mnetor!uunet!mcvax!hansm From: hansm@cwi.nl (Hans Mulder) Newsgroups: comp.editors Subject: Re: Query-replace on VI Message-ID: <303@piring.cwi.nl> Date: 6 May 88 17:41:01 GMT References: <2587@geac.UUCP> <27909@yale-celray.yale.UUCP> <86@skep2.ATT.COM> <393@aiva.ed.ac.uk> <3536@psuvax1.psu.edu> Organization: CWI, Amsterdam Lines: 16 In article <3536@psuvax1.psu.edu> schwartz@gondor.cs.psu.edu (Scott Schwartz) writes: >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? >Try this: >use "/from" to find your query >use ":s/from/to/" to replace it >then repeatedly use "/" to jump the the next instance of the from pattern, and >":s" to change it. When you get tired of hitting every other keystroke, use "n" to search forward to the next occurance of "from" "N" to search backward "&" to change it -- Hans Mulder hansm@cwi.nl mcvax!hansm