next up previous contents
Next: Emacs Up: Edit Previous: Edit   Contents

Vi

A basic full screen editor is vi (visual editor). It isn't very nice to use but is available on every UNIX machine, so it is worth learning just enough to do simple editing. To edit a file called myfile:-

vi myfile
vi operates in two modes: passive mode and insert mode. When you first enter vi it is in passive mode.

passive mode

In passive mode the user can move round the file using the arrow keys. To delete the character pointed to by the cursor press x and to delete the character to the left of the cursor press X. To switch to insert mode press i.

insert mode
In insert mode new material can be typed in. The delete key can be used to remove text added since insert mode was last selected although the text won't disappear from the screen until further text is typed in or passive mode is selected. To leave insert mode and return to passive mode press the escape key (Esc).

To exit from vi press Z twice whilst in passive mode. This introduction will just about get you started, see the help system for more information on vi.


next up previous contents
Next: Emacs Up: Edit Previous: Edit   Contents
P.D. Gronbech (IT Staff) 2015-10-02