home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!uwm.edu!rutgers!modus!gear!cadlab!martelli
- From: martelli@cadlab.sublink.org (Alex Martelli)
- Newsgroups: comp.editors
- Subject: Re: VI??? GROSS!
- Message-ID: <1992Nov17.082134.13232@cadlab.sublink.org>
- Date: 17 Nov 92 08:21:34 GMT
- References: <LYT86XN@math.fu-berlin.de> <1992Nov12.232530.18958@wixer.cactus.org> <1992Nov13.124435.20019@cas.org> <1992Nov13.152821.6781@nsisrv.gsfc.nasa.gov> <Z8U84BL@math.fu-berlin.de>
- Organization: CAD.LAB S.p.A., Bologna, Italia
- Lines: 80
-
- wolff@inf.fu-berlin.de (Thomas Wolff) writes:
-
- :Most repliers to my posting seem to be that well accustomed to the fact
- :that vi is a line editor that they didn't see my point when I wrote
- :"arbitrary (!) block of text" (well, maybe "block" was misleading). This
- :is not a block of lines (which is the unit of most vi operations) and
- :since I referred to "elementary text editing tasks" I didn't mean columns
- :either. Suppose I have the lines
- : word1 word2 word1
- : word3 word4 word3
- :and I need the text from "word2 " up to "word4" (assume it's a sentence)
- :to be copied or moved elsewhere.If an editor cannot do this with a
- :simple command sequence (and without the search trick burdening me with
- :the task of counting the occurences of the word following my sentence
- :within my sentence, if it can be done that way at all), I just do not
- :call it a text editor.
-
- You don't seem to be READING the responses to your post!
-
- 1. Place the cursor on the leading "w" of "word2".
- (by any means whatsoever).
-
- 2. Press: ma
- You have thus placed the marker named a on that point.
-
- 3. Place the cursor on the final "4" of "word4".
- (again, by any means whatsoever).
-
- 4. Press: mz
- You have thus placed the marker named z on that point.
- (note that you have 26 marks at your disposal, named a to z).
-
- 5. Press: `a
- You will move to the EXACT point of mark a, the leading w of "word2".
- Note that this is a BACKquote, also known as GRAVE ACCENT, *NOT* an
- apostrophe. The apostrophe would use the mark for line-oriented
- operation; the backquote uses it for character-stream operation.
- If you don't like this key assignment place a "map ' `" in your
- .exrc, and the apostrophe will start working in charstream too.
-
- 6. To COPY, press: "ay`z
- You have thus yanked the EXACT block of text you're interested in,
- into named-buffer a. Note that a BACKQUOTE is needed here, too,
- before the z, unless you've mapped things to work differently.
- (You have 26 named buffers at your disposal, named a to z).
- (If you *already* had text inside named-buffer a, and you wanted
- to APPEND these words to that, you could do this by pressing:
- "Ay`z - the uppercasing of the buffer name is the trick. By using
- the buffername in lowercase, the previous contents of the buffer
- are, instead, replaced).
-
- 6bis. Or, to MOVE, press: "ad`z
- You have thus *deleted* the exact block of text into the named buffer.
-
- 7. Now place the cursor wherever you wanted to place the text.
- (yet again, by any means whatsoever).
-
- 8. Press: "ap
- You have put named-buffer a's contents right after the cursorpoint.
- Or, Press: "aP to put the same contents right BEFORE the cursorpoint.
- Note that in either case the contents go within the textstream at
- the cursorpoint, as they have been yanked or deleted as textstream,
- not as whole lines.
-
-
- I don't claim this process is perfect. No immediate visual feedback
- is available of where marks are, or what you have yanked. The use
- of both lower and upper case for commands, which are not echoed, is
- at first confusing, although the mnemonic relationships make it
- rather commodious to use after a while (p-ut after, P-ut before;
- "a to overwrite buffer a, "A to append to it; and so on).
-
- I *DO* claim that you have flamed the vi editor, and by implication
- us, its users, WITHOUT having taken the trouble to learn it AT ALL!
- Such characterstream operation, and the backquote movement-command
- in particular, are not some sort of "exoterica", but, rather quite
- fundamental usage modes of this program!
- --
- Email: martelli@cadlab.sublink.org Phone: ++39 (51) 6130360
- CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia Fax: ++39 (51) 6130294
-