From owner-freebsd-doc Fri Sep 6 15:59:29 1996 Return-Path: owner-doc Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA06522 for doc-outgoing; Fri, 6 Sep 1996 15:59:29 -0700 (PDT) Received: from andrsn.stanford.edu (andrsn.Stanford.EDU [36.33.0.163]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA06496 for ; Fri, 6 Sep 1996 15:59:18 -0700 (PDT) Received: from localhost (localhost.Stanford.EDU [127.0.0.1]) by andrsn.stanford.edu (8.7.5/8.6.12) with SMTP id PAA11143; Fri, 6 Sep 1996 15:57:10 -0700 (PDT) Date: Fri, 6 Sep 1996 15:57:10 -0700 (PDT) From: Annelise Anderson Reply-To: Annelise Anderson To: Gary Kline cc: peter@taronga.com, doc@freebsd.org Subject: Re: vi tutorial In-Reply-To: <199609061726.KAA12896@athena.tera.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-doc@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 6 Sep 1996, Gary Kline wrote: > At any rate, if interested people would send me their > favor vi commands, I'll toss them into the brew and > then re-submit. > > gary Okay, these are my favorites: :se nu number lines "a10dd cut 10 lines of text starting at cursor, saving it in buffer a; or "a10yy copy 10 lines of text to buffer a :e filename edit filename without losing text in named buffers "ap paste text in buffer a at line following current line :x,yw filename copy lines x to y (x and y are numbers) to filename :x,yw >> filename append lines x to y to filename (there may be other better ways to do this) :r !cmd place output of cmd in text at cursor :r filename read filename into text :se nonu turn off line numbering And some I think you've already got, e.g., nG, Ctrl-G, n (repeat last search in same direction) and search and replace. Given Peter's explanation of the action of the cursor keys when in insert mode ^H^H^H^H^H^H^H^H^H^H^H^H when inserting: "When inserting text you can backspace over inserted text (although it won't disappear) and overstrike it. The use of any arrow key during an insertion completes the action (the text you backspaced over will disappear if not overstruck), moves the cursor in the direction of the arrow, and leaves you in insert mode ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H ^H^H^H^H^H^H^H^H^H starts another insert command." (Footnote: if you're using vi on a computer running some Un*x other than FreeBSD, you may need to call nvi instead of vi to make the arrow keys work this way.) I think that paragraph's a correct description of the action of the arrow keys when in insert, uh, when the insert command is active, but it may need a little fixing. Annelise