[comp.editors] vi cursor mapping?

zvr@natasha.cs.wisc.edu (Alexios Zavras) (04/10/90)

In article <2037@awdprime.UUCP>, news@awdprime.UUCP (USENET News) writes:
> In article <5841.261a0aba@vax1.tcd.ie> ghawkins@vax1.tcd.ie writes:
> 
> >is it possible to write a mapping or such like to write something at
the bottom
> >of the screen, e.g. when you press escape it'd say "press i or a to start
> >typing again"!
> Not really.

Why not ? Let's say that we want the `*' key to produce this message.
What's wrong with mapping

map *  :" Press i or a to start typing again^M

This goes off to the last line of the screen	(:)
writes the message as a comment			(" blah blah blah)
and returns to the cursor (carriage return)	(^M)

Works fine here,

-- zvr --
    +---------------------------+	Alexios Zavras
    | H eytyxia den exei enoxes |	zvr@cs.wisc.edu
    +-----------------------zvr-+	zavras@cs.wisc.edu
Live from:
Wisconsin: land of Orson Welles, Frank Lloyd Wright,
		   Harry Houdini  and Spencer Tracy
	       (of Joe McCarthy, too, but try to forget that)

nancym@microsoft.UUCP (Nancy McGough) (04/12/90)

In article <5841.261a0aba@vax1.tcd.ie> ghawkins@vax1.tcd.ie writes:
>is it possible to write a mapping or such like to write something at the bottom
>of the screen, e.g. when you press escape it'd say "press i or a to start
>typing again"!

If your .exrc file contains the line:

set showmode

then one of the following modes will be displayed in the lower right 
corner of your screen: INPUT MODE, REPLACE MODE, REPLACE 1 CHAR -- there
are probably some others that I don't know about.  When you are in 
command mode nothing is displayed.

I'm not sure if this feature is supported by all versions of vi...  I
just searched the vi man pages for "showmode" and it's not in there.
Hope it works for you.  It's really a great way to know what mode
you're in!

Nancy

new@udel.EDU (Darren New) (04/12/90)

In article <54052@microsoft.UUCP> nancym@microsoft.UUCP (Nancy McGough) writes:
>I'm not sure if this feature is supported by all versions of vi... 

Not in mine.  But I do have "set modeline" (which seems to have no
effect.  Doing ":set all" will show you everything that can be set.
Maybe you need a "status line" on the terminal and not just the last line.
			     -- Darren

maart@cs.vu.nl (Maarten Litmaath) (04/12/90)

In article <16640@estelle.udel.EDU>,
	new@udel.EDU (Darren New) writes:
)In article <54052@microsoft.UUCP> nancym@microsoft.UUCP (Nancy McGough) writes:
)>I'm not sure if this feature is supported by all versions of vi... 

[set showmode]

)Not in mine.  But I do have "set modeline" (which seems to have no
)effect.  [...]

According to the vi ref, `modeline' is something quite different:

    modeline                | When you read an existing file into the buffer,
                            |   and this option is set, the first and last 5
                            |   lines are checked for editing commands in the
                            |   following form:
                            |
                            |     <sp>vi:set options|map ...|ab ...|!...:
                            |
                            |   Instead of <sp> a <ht> can be used, instead of
                            |   `vi' there can be `ex'.  Warning: this option
                            |   could have nasty results if you edit a file
                            |   containing `strange' modelines.
--
 1) Will 4.5BSD have wait5()?         |Maarten Litmaath @ VU Amsterdam:
 2) Sleep(3) should be sleep(2) again.|maart@cs.vu.nl, uunet!mcsun!botter!maart

guy@auspex.auspex.com (Guy Harris) (04/13/90)

>I'm not sure if this feature is supported by all versions of vi...

It's not.  It appeared in some version done at AT&T (3.9, perhaps, which
showed up somewhere around System V Release 2), and is in the
S5R2-and-later version but not in any of the BSD versions I know of.