From owner-freebsd-questions Wed Jul 14 15:41:37 1999 Delivered-To: freebsd-questions@freebsd.org Received: from sand4.global.net.uk (sand4.global.net.uk [194.126.80.248]) by hub.freebsd.org (Postfix) with ESMTP id D369F154B1 for ; Wed, 14 Jul 1999 15:41:21 -0700 (PDT) (envelope-from marko@globalnet.co.uk) Received: from p11s12a06.client.global.net.uk ([195.147.220.18] helo=marder-1.) by sand4.global.net.uk with esmtp (Exim 2.12 #1) id 114Wlw-0006cE-00; Wed, 14 Jul 1999 22:41:00 +0100 Received: (from marko@localhost) by marder-1. (8.9.2/8.8.8) id WAA00595; Wed, 14 Jul 1999 22:36:17 +0100 (BST) (envelope-from marko) Date: Wed, 14 Jul 1999 22:36:17 +0100 From: Mark Ovens To: Jonathan Chen Cc: Anand Buddhdev , freebsd-questions@FreeBSD.ORG Subject: Re: key mapping in vi/nvi Message-ID: <19990714223617.B524@marder-1> References: <19990714183835.A269@marder-1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: ; from Jonathan Chen on Thu, Jul 15, 1999 at 08:57:41AM +1200 Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Jul 15, 1999 at 08:57:41AM +1200, Jonathan Chen wrote: > On Wed, 14 Jul 1999, Mark Ovens wrote: > > > 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 /From: postmaster/ > > > > > > > Try: > > > > map ^[OP :s/From: Anand Buddhdev /From: postmaster/^M > > The more portable way is to use > > map #1 :s/From: Anand Buddhdev /From: postmaster/^M > > which will read the terminfo/termap files for function key mappings. > Function keys #1 - #12 correspond to F1 - F12. > Thanks for the tip. > Jonathan Chen > --------------------------------------------------------------------- > Who dares nothing, need hope for nothing > > > > 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