From owner-freebsd-questions Wed Jul 14 14: 7:31 1999 Delivered-To: freebsd-questions@freebsd.org Received: from pinnacle.co.nz (pinnacle.internet.co.nz [210.48.55.133]) by hub.freebsd.org (Postfix) with ESMTP id BFB8014CC7 for ; Wed, 14 Jul 1999 14:07:10 -0700 (PDT) (envelope-from jonc@pinnacle.co.nz) Received: from kiwi.pinnacle.co.nz (kiwi.pinnacle.co.nz [202.37.163.2]) by pinnacle.co.nz (8.9.3/8.9.3) with ESMTP id IAA29154; Thu, 15 Jul 1999 08:57:41 +1200 (NZST) Date: Thu, 15 Jul 1999 08:57:41 +1200 (NZST) From: Jonathan Chen To: Mark Ovens Cc: Anand Buddhdev , freebsd-questions@FreeBSD.ORG Subject: Re: key mapping in vi/nvi In-Reply-To: <19990714183835.A269@marder-1> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. 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