home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:10715 comp.editors:2144
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!rutgers!modus!gear!cadlab!martelli
- From: martelli@cadlab.sublink.org (Alex Martelli)
- Newsgroups: comp.unix.questions,comp.editors
- Subject: Re: vi (cut and paste)
- Keywords: vi
- Message-ID: <1992Sep02.134055.11787@cadlab.sublink.org>
- Date: 2 Sep 92 13:40:55 GMT
- References: <3815@keele.keele.ac.uk> <1992Aug17.200149.7817@s912%bnf.com> <515@alden.UUCP>
- Organization: CAD.LAB S.p.A., Bologna, Italia
- Lines: 62
-
- sgr@alden.UUCP (Stan Ryckman) writes:
-
- :In article <1992Aug17.200149.7817@s912%bnf.com> bibb@s912%bnf.com (Ken Bibb) writes:
- :>In <3815@keele.keele.ac.uk> phd85@seq1.keele.ac.uk (D.H. Holden) writes:
- :>> hi,
- :>> Does anyone know how you cut a range of text to one
- :>> of the named buffers, where the range does not cover
- :>> an integer number of lines, i.e.,
- :>> How do i cut from here > text text text ..........
- :>> ............... n number of lines .....
- :>> ...... to here < into the named buffer "a for example?
- :>> Cheers,
- :>> Dave.
- :>In the following texT:
- :>aaabbbbbb
- :>bbbbbbbbb
- :>bbbbccccc
- :>
- :>I'll assume you want to cut the b's out and save them into buffer a.
- :>1) position the cursor at the beginning of the range to be cut (1Gfb will work
- :> in this example).
- :>2) ma (mark the location with marker a)
- :>3) move to the end of the range (Gfc will work in this example)
- :>4) "ad`a will cut the range and put it into buffer a
- :
- :NOT!
- :
- :This grabs all three full lines. (I tried it! Did you?)
-
- You are wrong. Yes, I did try Ken's suggestion, and it works perfectly!
- Your mistake is probably that sub 4), where Ken specifies a ` (reverse
- quote) you used a ' (quote); THAT would grab the three full lines!
-
- :Dave presumably wants to have the remaining text be:
- :aaaccccc
- :
- :and the buffer to contain:
- :bbbbbb
- :bbbbbbbbb
- :bbbb
-
- Which is EXACTLY what Ken's sequence does.
-
- :"Mark" (the "m" command) only marks the line, NOT the cursor
- :position within the line.
-
- You are wrong. m DOES mark the column position within the line; then,
- if you use a ' (quote) to get back to the mark, you'll use the full
- marked line, but if you use a ` (backquote) you'll get the exact
- portion of the line.
-
- :Am cross-posting to comp.editors, since someone there may know
- :for sure whether there _is_ a way to do this, and if I'm wrong I'd
- :like to know. But please, _TRY_ it before posting!
-
- The cross-posting was a good idea, since I'm reading this in
- comp.editors. And yes, I do know for sure, and YES, I *DID*
- try the exact sequence of commands which you claim fail, and
- they work like a charm.
- --
- Email: martelli@cadlab.sublink.org Phone: ++39 (51) 6130360
- CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia Fax: ++39 (51) 6130294
-