Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!kuhub.cc.ukans.edu!maverick.ksu.ksu.edu!unlinfo.unl.edu!hoss!sanjiv Newsgroups: comp.editors Subject: Re: Simple VI question? Message-ID: <1991May9.143842.27795@unlinfo.unl.edu> From: sanjiv@hoss.unl.edu (Sanjiv K. Bhatia) Date: Thu, 9 May 1991 14:38:42 GMT Sender: news@unlinfo.unl.edu References: <1991May9.024022.24367@massey.ac.nz> Organization: University of Nebraska - Lincoln Nntp-Posting-Host: hoss.unl.edu Lines: 24 In <1991May9.024022.24367@massey.ac.nz> news@massey.ac.nz (USENET News System) 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". All you need to do is to put a backslash in front of >. Thus, you should have: :'a,'z s/^/\>\>/ >Thanx >Raminder $ingh Sanjiv -- Sanjiv K. Bhatia Department of Computer Science sanjiv@fergvax.unl.edu Ferguson Hall 115 voice: (402)-472-3485 University of Nebraska - Lincoln fax: (402)-472-7767 Lincoln, NE 68588-0115