🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3424

Re: question about "vi"

#3424
From: The Silent Killer
Date: Sat, 11 Feb 1989 16:07
27 lines
1305 bytes
In article <740@bnlux0.bnl.gov> como@bnl-max (Andrew T. Como) writes:
>
>I have a question about vi.
>
>Here are five lines:
>	The cow jumped over the moon
>	The cow jumped over the moon
>	The cow jumped over the moon
>	The cow jumped over the moon
>	The cow jumped over the moon
>
>	How can I substitute /cow/dog only on lines 1 and 5
>

 Try /cow, then :/s/cow/dog followed by nnnn& 
 '&' repeats the previous substitution.

 Actually in this case, you can also try
  /cow [return] cwdog[escape]nnnn.  

 The first version has the advantage that it remembers only the 
 exact latest substitution done through 'ex' (i.e. in the command mode), 
 whereas the '.' command remembers any non-ex change like deleting
 a line, etc.  I am sure somebody will correct me if I am wrong.

 Anant Patkar
 (patkar@neon.ecn.purdue.edu)
Technical Details
Message-ID: <692@cb.ecn.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!pur-ee!pc.ecn.purdue.edu!cb.ecn.purdue.edu!patkar
References: <740@bnlux0.bnl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!pur-ee!pc.ecn.purdue.edu!cb.ecn.purdue.edu!patkar
From: patkar@cb.ecn.purdue.edu (The Silent Killer)
Newsgroups: comp.editors
Subject: Re: question about "vi"
Message-ID: <692@cb.ecn.purdue.edu>
Date: 11 Feb 89 16:07:15 GMT
References: <740@bnlux0.bnl.gov>
Reply-To: patkar@cb.ecn.purdue.edu.UUCP (The Silent Killer)
Organization: Purdue University Engineering Computer Network
Lines: 27