[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

VI & cursor keys



The problems with the cursor not moving to the first column occurs in
nvi (all versions, including latest alpha). It stems from the way the
cursor keys are implemented. They are not. One of the design directives
of nvi is to reproduce the behaviour of the historic vi as much as
possible. Historic vi didn't use cursor keys.
Nvi now maps and map!s the escape sequences produced by the cursor to keys
to vi commands, vis:
	:map
	^[OA  k     cursor up
	^[OB  j     cursor down
	^[OC  l     cursor right
	^[OD  h     cursor left
	:map!
	^[OA  ^[ka  cursor up
	^[OB  ^[ja  cursor down
	^[OC  ^[la  cursor right
	^[OD  ^[ha  cursor left
In command mode everything is ok, but in insert/append mode you first leave
insert/append mode, move one character and reenter *append* mode, which
leaves you on the second character. Actually, nvi 1.6[02] produce an error
if you try to move in column 1 and stay in command mode.

Since vim/elvis implement real cursor keys, they don't have this problem.
In the hope of having removed all clarities,
--
Cheerio, Jan
Jan Wender - wenderj@uni-trier.de - Universitaet Trier, Germany
postal://Germany/Trier/54292/Schoendorfer%20Str/5/Wender/Jan
Linux is the choice of a Gnu.


Reply to: