Terminal / vim / shortcuts

Jonathan Chen jonc at chen.org.nz
Sun Jun 14 05:07:43 UTC 2009

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.

Jonathan Chen <jonc at chen.org.nz>
             "A person should be able to do a small bit of everything,
                                        specialisation is for insects"

More information about the freebsd-questions mailing list