Date: Wed, 14 Jul 1999 18:38:35 +0100 From: Mark Ovens <markov@globalnet.co.uk> To: Anand Buddhdev <arb@anand.org> Cc: freebsd-questions@freebsd.org Subject: Re: key mapping in vi/nvi Message-ID: <19990714183835.A269@marder-1> In-Reply-To: <19990714104155.A13850@africaonline.co.ke>; from Anand Buddhdev on Wed, Jul 14, 1999 at 10:41:55AM %2B0300 References: <19990714104155.A13850@africaonline.co.ke>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 14, 1999 at 10:41:55AM +0300, Anand Buddhdev wrote:
> I've been trying to do some key mapping in vi, but I'm stuck. I can
> associate simple letters to words, eg. map n anand, so that a press of
> 'anand' will instead send 'anand' to the editor. However, I want to
> associate the function keys F1 to F12 with various more complex macros,
> for example a substitution macro, like:
>
> F1 = s/From: Anand Buddhdev <arb@anand.org>/From: postmaster/
>
Try:
map ^[OP :s/From: Anand Buddhdev <arb@anand.org>/From: postmaster/^M
Where ``^[OP'' is typed ``Ctrl-V F1'' and ^M is typed ``Ctrl-V
Ctrl-M''. Put the cursor on the start of the matching string, hit
F1, and voila. Works for me. If you want it global just add ``%''
between ``:'' and ``s''.
HTH
> This is so I can use vi with mutt, and change my from addresses with a
> single key rather than editing them everytime. Any help will be
> appreciated.
>
> --
> Anand
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>
--
FreeBSD - The Power To Serve http://www.freebsd.org
My Webpage http://www.users.globalnet.co.uk/~markov
_______________________________________________________________
Mark Ovens, CNC Apps Engineer, Radan Computational Ltd. Bath UK
CAD/CAM solutions for Sheetmetal Working Industry
mailto:markov@globalnet.co.uk http://www.radan.com
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?19990714183835.A269>
