[comp.editors] Question about vi macros

alex@wolf.umbc.edu (Alex Crain) (04/17/89)

In article <1915@umbc3.UMBC.EDU> rostamia@umbc3.UMBC.EDU (Rouben Rostamian) writes:

>Now my question is this:  How can I get the first column in the listing 
>to display "Next_Screen" or something like it, as the folks who wrote vi 
>were able to do with their key definitions? 

	Sorry, you can't. Terminals are all described in the file
/etc/termcap, and there are fields for the left, right, up, and down
keys. When vi starts up, it binds to the "left" key, not ^[[0A or
whatever it is on you're terminal. Since there is no termcap field for
a "next page" key, you have to bind to ^[F~, with no name.

					:alex
Alex Crain
Systems Programmer			alex@umbc3.umbc.edu
Univ Md Baltimore County		umbc3.umbc.edu!nerwin!alex

gwyn@smoke.BRL.MIL (Doug Gwyn) (04/17/89)

In article <1919@umbc3.UMBC.EDU> alex@wolf.umbc.edu.UUCP (Alex Crain) writes:
>Since there is no termcap field for
>a "next page" key, you have to bind to ^[F~, with no name.

I don't know whether or not this helps address the original question,
but there most certainly is a termcap capability for the string sent
by a "next page" key:  it's "kN".  Whether or not particular software
supports it is a separate issue.

	- D A Gwyn
	  4.3BSD termcap(5) editor

diomidis@ecrcvax.UUCP (Diomidis Spinellis) (04/18/89)

In article <1915@umbc3.UMBC.EDU> rostamia@umbc3.UMBC.EDU (Rouben Rostamian) writes:
>[ Asks how he can set up the comment field of the vi map listing in the
> way it is done with the arrow keys.]

There is no way to set the comment field of an arbitrary key.  You can
however have the function keys have meaningful identifiers by mapping them
as #n (where n is the number of the function key).  Thus ``:map #6 w'' will
map function key 6 to w and will be listed as something like:
f6	^[[17~	w
The arrow key names are hard-coded in vi and apart from the function keys
special case the other mappings have the left hand side of the map used 
as the key name.

--
Diomidis Spinellis