Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tektronix!tekgen!jerryp From: jerryp@tekgen.TEK.COM (Jerry Peek) Newsgroups: comp.unix.questions Subject: Re: vi tips- summary number one Message-ID: <1741@tekgen.TEK.COM> Date: Mon, 14-Sep-87 22:33:40 EDT Article-I.D.: tekgen.1741 Posted: Mon Sep 14 22:33:40 1987 Date-Received: Wed, 16-Sep-87 06:58:43 EDT References: <601@augusta.UUCP> <8524@mimsy.UUCP> <2280@sphinx.uchicago.edu> Reply-To: jerryp@tekgen.TEK.COM (Jerry Peek) Followup-To: comp.unix.questions Organization: Tektronix, Inc., Beaverton, OR. Lines: 64 Keywords: vi tips, summary, good stuff, help with vi [I've taken comp.unix.wizards off the list, and restricted followups to comp.unix.questions.] In article <2280@sphinx.uchicago.edu> d757@sphinx.UUCP (Lawrence Lerner) writes: > Here is a quickie vi ref card for those that don't have acces to one. > > ============================Cut Here=========================================== > Unix vi Reference Card > With, I think, some errors. Let's see if I can help here. [Oh no -- vi command wars! :-)] > p put before cursor P put before line Instead, I'd say: p put after cursor P put before cursor or after line or before line > In order to delete or yank a section of text, you must place a > mark to where the deletion/yank is to stop. Not true. You don't have to delete or yank to a mark. You can delete or yank to 'most any location command. For example: y/Fred yank until the word Fred "ty/Fred yank until the word Fred, store in buffer "t d23G delete from here to (and including) line 23 y2t- yank from here to the second-following hyphen in line etc. etc. Marks are handy for this, but not required. > J adjoin current line to line above No. This joins the current line to the line *below*. > !! place results of command into file i.e. !!cat it.p will place > the list of it.p in your file. Oops. This *replaces the current line* with the contents of the it.p file. What you want, I think, is: :r it.p This will read the contents of it.p into the buffer beneath the current line. > Unix ex Reference Card >... > a append lines after this line; end insertion with "." > i insert lines after this line; end insertion with "." The i command inserts lines *before* the current line. --------------------------------------------------------------------------- --Jerry Peek uucp-style: {allegra,decvax,hplabs,ihnp4,ucbvax}!tektronix!tekgen!jerryp Domain-style: jerryp@tekgen.TEK.COM Phone: +1 315 445-9379