Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Sep 1996 15:57:10 -0700 (PDT)
From:      Annelise Anderson <andrsn@andrsn.stanford.edu>
To:        Gary Kline <kline@tera.com>
Cc:        peter@taronga.com, doc@freebsd.org
Subject:   Re: vi tutorial
Message-ID:  <Pine.BSI.3.94.960906145444.11071A-100000@andrsn.stanford.edu>
In-Reply-To: <199609061726.KAA12896@athena.tera.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.94.960906145444.11071A-100000>