Subject: Vi motion keys
To: None <PORT-MAC68K@netbsd.org>
From: Steve Revilak <revilak@umbsky.cc.umb.edu>
List: port-mac68k
Date: 11/02/1998 04:08:37
/Philippe> How I chance the word and move the cursor ???
/
/'man vi' shows how to move the cursor, but I'll go to
/explain.  vi/ex uses 4 keys 'hjkl' to move the cursor.

A nicer alternative is to create a .exrc file in your home directory,
which will automatically map the motion keys to the arrow keys.  Try
this:


-------------start below this line---
map <Ctrl-v><Left arrow> h
map <Ctrl-v><down-arrow> j
map <Ctrl-v><up-arrow> k
map <Ctrl-v><right-arrow> l

Note, <Ctrl-v> means to hold the control key and press 'v' at the same
time. <XX-arrow>means press the XXX arrow key on your keyboard.

A few other tips for getting started:

Get into command mode (press ESC).  Then press a colon (you'll see a
colon appear at the botton of the screen.  This is where you issue ex
commands.  Try the following:

set all (Shows current settings of all options.  You can change these
and place those changes in .exrc to have them done automatically.

viusage (Shows all of the vi command mode keys).

exusage (shows all of the ex commands).

Track down a copy of the 'vi-Faq'.  Usually it's posted to the
comp.unix.* groups every few weeks.  You'll find a bunch of neat tricks
in there.

Steve Revilak
revilak@umbsky.cc.umb.edu