[comp.editors] vi doubleescape feature

QQ11@LIVERPOOL.AC.UK (11/30/90)

This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
When set, 2 consecutive ESCs are required to exit from input mode.
It's very useful when supporting the arrow keys and allows full/proper
cursor movement in input mode.
However a quick check on other systems indicates that this feature is not
widespread. It's not available under SunOS 4.1 , SCO Un*x 3.2
and I assume 4.3 BSD and SVr3. The "User's Guide" for SVr4 makes no
mention (but then it makes no mention of a number of things :-)).

Do any other vi versions have this feature and/or is there a 'catch' ?

Thanks.

Alan Thew  : University of Liverpool Computer Laboratory
Bitnet/Earn: QQ11@LIVERPOOL.AC.UK or QQ11%UK.AC.LIVERPOOL @ UKACRL
    UUCP   :           ....!mcsun!ukc!liv!qq11
   Voice   :  +44 51 794 3735        FAX : +44 51 794 3759
Internet   : QQ11@LIVERPOOL.AC.UK or QQ11%LIVERPOOL.AC.UK @ NSFNET-RELAY.AC.UK

tmb@bambleweenie57.ai.mit.edu (Thomas M. Breuel) (12/03/90)

In article <90333.192627QQ11@LIVERPOOL.AC.UK> QQ11@LIVERPOOL.AC.UK writes:
   This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
   When set, 2 consecutive ESCs are required to exit from input mode.
   It's very useful when supporting the arrow keys and allows full/proper
   cursor movement in input mode. [...]
   Do any other vi versions have this feature and/or is there a 'catch' ?

Sounds unnecessary: vi already disambiguates arrow keys from
user input by using timing information. For example, you can
type:

	:map! ^V^[OA ^V^[ka

to have the uparrow key function in insert mode.

Unless you have a very slow connection and are a very fast typist,
this should not present a problem.

I personally would hate it if I had to type <ESC> twice to get out
of insert mode.

vic@grep.co.uk (Victor Gavin) (12/04/90)

In article <TMB.90Dec2190057@bambleweenie57.ai.mit.edu> tmb@bambleweenie57.ai.mit.edu (Thomas M. Breuel) writes:
>In article <90333.192627QQ11@LIVERPOOL.AC.UK> QQ11@LIVERPOOL.AC.UK writes:
>   This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
>   When set, 2 consecutive ESCs are required to exit from input mode.
>
>Sounds unnecessary: vi already disambiguates arrow keys from
>user input by using timing information.
>
>Unless you have a very slow connection and are a very fast typist,
>this should not present a problem.

HP also provide a ``set'' option to specify the max amount of time between
receiving the ESC key and a following key. If nothing is received in this time,
you get an ESC operation otherwise you get a softkey operation. This lets
people on slow dialups or network connections have proper working keyboards
without affecting people on consoles or fast serial lines (who can shorten
their timeouts to next to nothing).

As to the double escape feature: it's there to prevent you accidently typing
the escape sequence sent out by a softkey (eg on HP keyboards, the up arrow
sends out the sequence ^[A, which can be quite easily typed in manually when
you are in insert mode and want to append at the end of the line).


				vic
--
Victor Gavin <vic@grep.co.uk||vic@grep.uucp||..!ukc!grep!vic||+44 532 500303>
Grep Limited, Kirkfields Business Centre, Kirk Lane, Leeds, UK, LS19 7LX

richard@mqcomp.mqcc.mq.OZ (Richard Miller) (12/06/90)

In article <90333.192627QQ11@LIVERPOOL.AC.UK> QQ11@LIVERPOOL.AC.UK writes:
>This is available with vi under HP-UX 7.0 (and HP-UX 6.5 and before (??)).
>When set, 2 consecutive ESCs are required to exit from input mode.
>It's very useful when supporting the arrow keys and allows full/proper
>cursor movement in input mode.
>However a quick check on other systems indicates that this feature is not
>widespread. It's not available under SunOS 4.1 , SCO Un*x 3.2
>and I assume 4.3 BSD and SVr3. The "User's Guide" for SVr4 makes no
>mention (but then it makes no mention of a number of things :-)).
>
>Do any other vi versions have this feature and/or is there a 'catch' ?
>

I've not noticed this feature  - I must give it  a go.

But most version (SunOS 4.1 etc) use a time out so that if 
an ESC and another char is received in quick succession
it is treated an ESC sequence, otherwise it is an ESC and then the
char.  This make curor movement in insert  mode a macroable thing.

This seems to be how all multiple char marcos are handled.

Richard
 ____________________________________________________________________________
|   __                                                                       |
|  /_/ -__ /_ _ _ _ __/  /\/\ -//  _                                         |
| / \ /(_ / /(_/ / (_/  /   ////(~/                                          |
|                                                                            |
| School Math, Physics, Elec and Computing, Macquarie University SYDNEY AUST.|
|  Email: richard@mqcomp.mqcs.mq.oz.au ,Ph:+61 2 8058374, Fax:+61 2 8058983  |
|____________________________________________________________________________|

sartin@hplabsz.HPL.HP.COM (Rob Sartin) (12/07/90)

If you've ever used an error correcting modem (on a noisy line) or a
slow (or error prone) network connection, you know that any mechanism
involving timeouts on multicharacter sequences is subject to all sorts
of fun errors.  If you use vi in this type of situation you will find
that doubleescape is a wonderful addition.  If not, then you can
probably rely on the timeouts and have no problems.

Disclaimer: If HP had a net.spokesperson it wouldn't be me.

Rob

wyle@inf.ethz.ch (Mitchell Wyle) (12/07/90)

In <6328@hplabsz.HPL.HP.COM> sartin@cup.hp.com (Rob Sartin) remarks:
>If you've ever used an error correcting modem (on a noisy line) or a
>slow (or error prone) network connection, you know that any mechanism
>involving timeouts on multicharacter sequences is subject to all sorts
>of fun errors.  If you use vi in this type of situation you will find
>that doubleescape is a wonderful addition.  If not, then you can
>probably rely on the timeouts and have no problems.

Vi also has the z (window) command.  To quote from Maarten Litmaath's
reference quide,


    If in the next commands the field <wi> is present, the windowsize
    will change to <wi>. The window will always be displayed at the
    bottom of the screen.  [*] is an optional line number.



    [*]z[wi]<cr>            | Put line <*> at the top of the window
                            |   (default the current line).
    [*]z[wi]+               | Put line <*> at the top of the window
                            |   (default the first line of the next page).
    [*]z[wi]-               | Put line <*> at the bottom of the window
                            |   (default the current line).
    [*]z[wi]^               | Put line <*> at the bottom of the window
                            |   (default the last line of the previous page).
    [*]z[wi].               | Put line <*> in the centre of the window
                            |   (default the current line).


when working on a telephone line, I usually set the window size to 7 lines.

-Mitch