[comp.misc] VI editor

davidt@psuhcx (Thomas S. David) (01/11/89)

Hi there..
	I was wondering if any one out there had an answer to
the following question.

	Why does the cursor move one character to the left in the
VI editor  when one gets out of insert mode..(on any UNIX system..) ?. 
( apparently this "feature" does not exist in any other editors...)...

		This might sound like a trivial question..(it is I
guess :-))...this came up in a discussion with a friend of mine about
the differences in editors...

			Thanks...
			  Tom..

E-mail addresses
----------------
davidt@psuhcx or davidt@hcx.psu.edu or dst@psuecl or dst@ecl.psu.edu
k1a@psuecl or k1a@ecl.psu.edu or psuvax1!hcx.psu.edu!davidt

pag@tcsc3b2.UUCP (Philip A. Gross) (01/14/89)

In article <1141@psuhcx.psu.edu>, davidt@psuhcx (Thomas S. David) writes:
> Hi there..
> 	I was wondering if any one out there had an answer to
> the following question.
> 
> 	Why does the cursor move one character to the left in the
> VI editor  when one gets out of insert mode..(on any UNIX system..) ?. 
> ( apparently this "feature" does not exist in any other editors...)...
> 
> 		This might sound like a trivial question..(it is I
> guess :-))...this came up in a discussion with a friend of mine about
> the differences in editors...

As it appears to me, the cursor in VI when in INSERT or OPEN MODE is
being positioned where the _NEXT_ character to be inserted is to go.

If the cursor was to stay in the position that it was at when the ESCAPE
key is pressed, what would be there?  A space?  This would then require
a person to go and delete that space at the completion of the INSERT MODE.

The cursor, therefore, moves back one character at the end of the
INSERT MODE in order to place the cursor on the last character typed.

To look at it a different way, VI is a modal editor, if you will.  You
must explicitly state what type of mode you want (insert, open, append,
replace,...) while most other editors that you may have worked with such
as EMACS or perhaps the old EDT editor used in DEC's VMS are considered
to be command editors where the user is usually always in a state of
insertion or replacement and must enter certain key sequences in order
to perform other miscellaneous operations.

Perhaps one could also ask why the sun always rises in the east and
sets in the west.  I would say that it is not a "feature" but rather 
a necessity.


========================================+======================================
Philip A. Gross				|
The Computer Solution Co., Inc.  	|  I haven't heard what I have
1009 Sycamore Square, P.O. Box 716	|  to say about that yet.
Midlothian, VA  23113-0716	   	|
Voice: (804)794-3491		   	|
----------------------------------------+--------------------------------------
INTERNET:	pag%tcsc3b2@wb3ffv.ampr.org
USENET:		...!ames!haven!aplcen!wb3ffv!tcsc3b2!pag
UUCP:		tcsc3b2!pag		(804)794-1514
ATTMAIL:	attmail!tcsc3b2!pag
*******************************************************************************
	The opinions expressed here are strictly mine and nobody elses.
===============================================================================