From owner-freebsd-questions Wed Jul 14 10:48:15 1999 Delivered-To: freebsd-questions@freebsd.org Received: from sand2.global.net.uk (sand2.global.net.uk [195.147.246.100]) by hub.freebsd.org (Postfix) with ESMTP id BFE7214FC4 for ; Wed, 14 Jul 1999 10:48:05 -0700 (PDT) (envelope-from marko@globalnet.co.uk) Received: from p73s02a06.client.global.net.uk ([195.147.210.116] helo=marder-1.) by sand2.global.net.uk with esmtp (Exim 2.05 #1) id 114T8O-0008Ju-00; Wed, 14 Jul 1999 18:47:57 +0100 Received: (from marko@localhost) by marder-1. (8.9.2/8.8.8) id SAA00317; Wed, 14 Jul 1999 18:38:35 +0100 (BST) (envelope-from marko) Date: Wed, 14 Jul 1999 18:38:35 +0100 From: Mark Ovens To: Anand Buddhdev Cc: freebsd-questions@freebsd.org Subject: Re: key mapping in vi/nvi Message-ID: <19990714183835.A269@marder-1> References: <19990714104155.A13850@africaonline.co.ke> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.3i In-Reply-To: <19990714104155.A13850@africaonline.co.ke>; from Anand Buddhdev on Wed, Jul 14, 1999 at 10:41:55AM +0300 Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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