🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3403

Re: Vi mapping question

#3403
From: Joe Boykin
Date: Wed, 21 Dec 1988 20:37
44 lines
2166 bytes
In article <2588@udccvax1.acs.udel.EDU> fowser@vax1.acs.udel.EDU (Scott Fowser) writes:
>How can the "V" key be defined so as to act like the "H" command, while
>the "H" key is defined to be "12h"?
>
>I have tried
>    :map V H
>    :map H 12h
>with and without remap set, and can only get one of the keys to do what I
>want.  I have also tried
>    :map V :set noremap^MH:set remap^M
>but it still does not work.


The first problem is that the mappings are not doing exactly what you want
them to.  Think of them as "text replacement" more than changing how a
particular capability is invoked.  If you issue the two MAP commands
you have above then the "V" command would actually issue the "12h"
command.  If you remap the "H" key, there is no way (except with
other sequences of commands which provide the same functionality) to
obtain that same function.

The second problem is that when you issue the commands as shown above,
the mapping of V is deleted when you do the mapping of H.  The reason for 
this is that that the "source" for the second map command ("H"), is found
in the "replacement" string of the first, and that slot is reused.  I always
thought this was a bug.

Issue the MAP commands in reverse order and you will find that both now
exist.

If "noremap" is set than the "V" will do what you want since this will
not be remapped to 12h.  That's the good news.  The bad news is that this
also prevents the H macro from working; I'm not sure why.  I have a feeling
that getting into the debbuger is the only way to figure it out.

----

Joe Boykin
Encore Computer Corp
Chairman, IEEE Computer Societies'
    Technical Committee on Operating Systems

UUCP: encore!boykin
ARPA: boykin@encore.com
Technical Details
Message-ID: <4452@xenna.Encore.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bu-cs!encore!multimax!boykin
References: <2588@udccvax1.acs.udel.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!bu-cs!encore!multimax!boykin
From: boykin@multimax.Encore.COM (Joe Boykin)
Newsgroups: comp.editors
Subject: Re: Vi mapping question
Message-ID: <4452@xenna.Encore.COM>
Date: 21 Dec 88 20:37:21 GMT
References: <2588@udccvax1.acs.udel.EDU>
Sender: news@Encore.COM
Reply-To: boykin@multimax.UUCP (Joe Boykin)
Organization: Encore Computer Corp, Marlboro, MA
Lines: 44