🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #101

Re: HELP with Vi, PLEASE!!!

#101
From: Eugene Fornario
Date: Mon, 03 Aug 1992 17:17
106 lines
5096 bytes
In article <pyqmhdh.lindae@netcom.com> lindae@netcom.com () writes:
>
>
>As a new user to Unix and to Vi, I must say that the online manual for
>vi is absolutely no help at all!!  Can't someone come up with a simple
>manual or easy-to-use tutorial for new users?  Why must it be so
>complicated?
>
>So far, by hit and miss, I've figured out how to type a letter, post
>news, etc. with vi and how to get out of it when I am done (:wq)  I've
>also figured out how to delete a whole line (esc dd) 
>
>What I absolutely can not figure out is, how do I make corrections? 
>For example, in this posting, suppose I wanted to go back up to
>line number 2 and change the word "can't" to "can not" ?  How would I
>do that?
>
>Your help will be greatly appreciated!
>
>
>
>
I've been wavering between making this a private or public post, but
maybe others with similiar questions could use the information.

I've been helped a good deal by buying a book on vi and Unix.  There
are some really good ones out there that make sense of it all using
plain english and easy to follow illusrations.  Here's a few:

Unix Primer Plus  by the Waite Group- A very good overview of the
      		  Unix operating system, includes chapters on the 
		  vi and emacs editors.  Definitely for the 
		  beginner.

Learning the vi editor  by Linda Lamb  publisher: O'Reilly & Associates.
		  This is a dedicated vi book, and although you can go
		  as far as you like, the first three chapters acqaint
		  the reader with the basics, plenty enough to start
		  it for sending and replying to email, as I'm doing
		  right now.  

Unix for People   by Birns, Brown, & Muster  pub:  Prentice Hall
		  This will also start you off with the basics, and it
		  goes on to cover formatting and typesetting
		  programs such as 'nroff' and 'troff'.  If you went 
		  through the whole book, you could write your own!


So there's a few reading suggestions.  I'd go from top to bottom in 
order of preference.  Vi is the basic full screen text editor found
on all Unix systems.  Emacs is a more powerful editor, but may not
be installed on all systems.  I like vi because I find it a really
quick and simple way to do on-line text editing.  I call into my
Unix system by modem.  If the job is too large, I use my PC's text
editor or word processor to do the job, then I upload the file to
my public access Unix.  In short, if you are accessing Unix via
your PC, use your PC's editor and save the connect time.

Ok, now a few vi basics to get started.  Most text editors allow
you to enter text using the keyboard, and at the same time give
commands using 'Ctrl' or "Alt' key combinations. Vi separates
the two actions-typing in text, and editing commands- into two
modes, the COMMAND mode and the INSERT text mode.  In the 
command mode you can move around the text, delete, change, replace,
and move text. From command mode you can go into insert mode to
type in text.  The only thing you can do there backspace over your
mistakes, onece you hit return, you can't go back to that line 
while you are in insert mode.  You have to go back to command mode
to do that.  You press ESC to do that.  To make sure, press ESC
again, your terminal will 'beep' at you, that way you know.

Here's a few commands: 

vi 'filename'   Either one you want to create or an existing file.
		You are then placed in command mode.  To get back 
                to the Unix prompt, type 'ZZ' (uppercase only) and
		press RETURN to save and exit or :q! to leave the
		file unchanged, and get out.

Entering text:  'i' for 'insert text'.  You are now in Insert mode
		where you enter your text.  Press ESC to get back to
		command mode.  Press ESC again if you want to be sure.
		The beep will be your assurance that you are.

cursor movement (command mode)
		'h'  one character left <      Ctrl-d  move down half a screen
		'l'  one character right >     Ctrl-u  move up half a screen.
		'j'  one line down  v          1G      move to the top of file.    
		'k'  one line up    ^          G       move to the end of file.


deletion        'x'  delete the character the cursor is under.
		'dw' delete one word
		'D'  Delete to the end of the line.
		'dd' delete the entire line.

You can then go back into Insert mode to replace the deletions if you need to.
You can change a character in command mode.  Place the cursor under the 
character you want to change and type 'r' followed by the character you
want to replace, you will still be in command mode.

Ctrl-l redraws the screen-sometimes neccesary on some terminals.

That should get you started.

Gene--
Technical Details
Message-ID: <gztmr#=.genef@netcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!decwrl!csus.edu!netcomsv!mork!genef
References: <pyqmhdh.lindae@netcom.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.editors
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!decwrl!csus.edu!netcomsv!mork!genef
From: genef@netcom.com (Eugene Fornario)
Subject: Re: HELP with Vi, PLEASE!!!
Message-ID: <gztmr#=.genef@netcom.com>
Date: Mon, 03 Aug 92 17:17:14 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
References: <pyqmhdh.lindae@netcom.com>
Lines: 107