Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!haven.umd.edu!umbc3.umbc.edu!math16.math.umbc.edu!rouben From: rouben@math16.math.umbc.edu (Rouben Rostamian) Newsgroups: comp.editors Subject: Re: Simple VI question? Message-ID: <1991May9.103552.11085@umbc3.umbc.edu> Date: 9 May 91 10:35:52 GMT References: <1991May9.024022.24367@massey.ac.nz> Sender: newspost@umbc3.umbc.edu (News posting account) Organization: University of Maryland Baltimore County, Mathmatics Department Lines: 21 In article <1991May9.024022.24367@massey.ac.nz> R.Singh@massey.ac.nz (R. Singh) writes: >How does one do this in VI. >Mark 2 lines, and then from ":'a, 'z" append a >> at the beginning of every >line. For example for whole file, a command of ":g/^./s//la/g" would >substitute the first 2 characters of every line with la. > >What I want to do is insert >> before every line in the region marked with >"ma" and "mz". Try :'a,'zs/^/>>/ I prefer to mark one end of the range, say by m, the go to the other end and do :'m,.s/^/>>/ -- Rouben Rostamian Telephone: (301) 455-2458 Department of Mathematics and Statistics e-mail: University of Maryland Baltimore County bitnet: rostamian@umbc.bitnet Baltimore, MD 21228, U.S.A. internet: rouben@math9.math.umbc.edu