Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!husc6!yale!chen-dahe From: chen-dahe@CS.YALE.EDU (Dahe Chen) Newsgroups: comp.editors Subject: Re: question about "vi" Message-ID: <50519@yale-celray.yale.UUCP> Date: 13 Feb 89 20:04:29 GMT References: <740@bnlux0.bnl.gov> Sender: root@yale.UUCP Reply-To: chen-dahe@CS.YALE.EDU (Dahe Chen) Organization: Yale University Computer Science Dept, New Haven CT 06520-2158 Lines: 35 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 > >I guess what I'm asking is if I >search for cow - /cow/ >now substitute - s/cow/dog/ >skip the next 3 lines n n n >...how can I re-issue the same substitution when I come to line 5 > > >Thanks in advance for the help > Two ways you can do it: 1. Move the curosr to the line you want to substitute and type &, or 2. do :#& where # is the line number. ------- Dahe Chen internet: dchen@twolf.ce.yale.edu ( @venus.ycc.yale.edu ) chen-dahe@cs.yale.edu bitnet: dchen@yalevms