Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2002 13:46:50 -0800
From:      Kent Stewart <kstewart@owt.com>
To:        Cliff Sarginson <csfbsd@raggedclown.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: vi question
Message-ID:  <3C87DFCA.9010400@owt.com>
References:  <OE136NoNBpsiLEMv9TL00016cbd@hotmail.com> <E16j4bb-0001cW-00@gull.prod.itd.earthlink.net> <20020307210508.GB484@raggedclown.net>

next in thread | previous in thread | raw e-mail | index | archive | help


Cliff Sarginson wrote:

> On Thu, Mar 07, 2002 at 02:34:51PM -0600, Bob Giesen wrote:
> 
>>On Thursday 07 March 2002 01:11 pm, Seth Hieronymus wrote:
>>
>>>Is there any way to stop vi from going back into command mode when
>>>I arrow over to the first column (while in insert mode)?
>>>
>>   I don't think so.  You could use Vim, instead; this seems to work 
>>as you'd like it to.
>>   More to the point is that you're using arrow keys in vi, which is 
>>optimized for fast typing (little wasted motion and little need for 
>>Ctrl- or Alt-key combinations).  Personally, I find it faster to just 
>>switch between command and insert modes and use the h,j,k, and l keys 
>>instead of the arrow keys...  Ymmv, of course, but you might want to 
>>give it a chance, if you haven't already.
>>
>>
> Mmm, this is one of the mysteries of vi.
> The arrow keys *may* work, they do for me, on most of the computers
> I use. It depends on terminal type, terminal emulation, and the 
> position of the stars.
> 
> But on some systems, they exhibit the behaviour you mention.
> 
> This has to do with the <esc> character.
> The <esc> brings you back to command mode as you know.
> <esc> is also the "lead-in" character for "escape-sequences"
> the left arrow for example is:
> ^[[D
> 
> ^[ = <esc>.
> 
> Now vi should wait a little while to see if <esc> is just <esc> or
> whether it is a lead in to an escape sequence..which of course happens
> very fast, so the wait only has to be very short. However sometimes vi
> just does not seem to wait long enough.


We used to have a Cray where I worked and it wasn't the sequence that 
did it as much as the repeat key frequency on the computer editing the 
file. We felt the computer was seeing multiple <esc> in a row because 
of the repeat key behaviour and an arrow command <esc> butchered arrow 
command dropped vi into command mode.

Kent


> 
> Because of this oddity most "vi veterans" use the keyboard movement keys
> and just switch mode as a matter of habit...because this will always
> work.
> 
> As mentioned above I don't think other vi clones suffer from this
> abberation, try them (vim or nvi).
> 
> You see "vi" is not a screen editor, it is a front end into a
> line-editor; this upsets people used to "real" screen editors.
> 
> 


-- 
Kent Stewart
Richland, WA

http://users.owt.com/kstewart/index.html


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C87DFCA.9010400>