From owner-freebsd-questions@FreeBSD.ORG Sun Jun 14 05:07:43 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30511106566B for ; Sun, 14 Jun 2009 05:07:43 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: from chen.org.nz (ip-58-28-152-174.static-xdsl.xnet.co.nz [58.28.152.174]) by mx1.freebsd.org (Postfix) with ESMTP id D10478FC13 for ; Sun, 14 Jun 2009 05:07:42 +0000 (UTC) (envelope-from jonc@chen.org.nz) Received: by chen.org.nz (Postfix, from userid 1000) id 271B328418; Sun, 14 Jun 2009 17:07:41 +1200 (NZST) Date: Sun, 14 Jun 2009 17:07:41 +1200 From: Jonathan Chen To: Daniel Underwood Message-ID: <20090614050741.GA12776@osiris.chen.org.nz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-questions@freebsd.org Subject: Re: Terminal / vim / shortcuts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 05:07:43 -0000 On Sat, Jun 13, 2009 at 08:18:02PM -0400, Daniel Underwood wrote: > I edit python code in vim using Terminal on xfce. I find myself, not > surprisingly, having to exit "insert mode" and save changes frequently > (when making code changes and wishing to test the immediate effects of > the changes in a separate terminal). This requires pressing 4 keys: > "esc", ":", "w", and "enter". How can I configure a shortcut (ideally > using an F# key) that will perform this sequence of 4 key-presses? Dunno about vim, but for vi, I'd put the following into ~/.exrc map #5 ^[:w^M where ^[ is "esc", and ^M is "enter". This maps the keys to F5. Cheers. -- Jonathan Chen ---------------------------------------------------------------------- "A person should be able to do a small bit of everything, specialisation is for insects"