Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 2009 17:07:41 +1200
From:      Jonathan Chen <jonc@chen.org.nz>
To:        Daniel Underwood <djuatdelta@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Terminal / vim / shortcuts
Message-ID:  <20090614050741.GA12776@osiris.chen.org.nz>
In-Reply-To: <b6c05a470906131718w521250e7u6f83d384e6500bc3@mail.gmail.com>
References:  <b6c05a470906131718w521250e7u6f83d384e6500bc3@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jonc@chen.org.nz>
----------------------------------------------------------------------
             "A person should be able to do a small bit of everything,
                                        specialisation is for insects"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090614050741.GA12776>