Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: local keymaps



} Andrej Borsenkow wrote:
} 
} > Unforunately, after
} > 
} > bindkey -A vicmd main
} > 
} > no more input is possible. I would expect, that at least `a' would
} > bring me back to viins.

In vi mode, the main keymap is viins and vicmd is the alternate keymap.
ESC in viins switches to the alternate keymap, and `a' in vicmd switches
to the main keymap.  So if you make vicmd the main keymap, you can never
make it go away, because it just switches to itself.

I don't know whether it'd be possible to make `a' in vicmd always switch
to viins even when that isn't the usual main keymap.  Now that we have
this local keymap stuff, it might be easier.

I'm not sure whether there are any restrictions on what goes into the
alternate keymap.  For example, you could make viins the main keymap and
emacs the alternate keymap, so that hitting ESC takes you into emacs
bindings -- but then I'm not sure whether something in the emacs keymap
might assume that it's the main keymap and/or accidentally pop you back
into the main keymap.

On Jun 23, 11:53am, Sven Wischnowsky wrote:
} Subject: RE: PATCH: local keymaps
}
} > May be, it's time to allow for binding of generic keys instead of just
} > escape sequences. E.g. in vim (or elvis) you can map charaters Right,
} > Left, Home, F1 etc. Let's be more user friendly :-)
} 
} Yes, I was wishing we had this when adding the keymap to complist (we
} would need an option for this to bindkey, though, because `bindkey Up' 
} currently binds the two-character sequence `U' `p').

You just need a special syntax for the named keys.  Z-Mail Lite has vaguely
emacs-like key-rebinding capabilities and keymaps, and uses the sequence
\<name> to refer to named keys, e.g. \<ctrl+A>, \<newline>, \<pageup>, etc.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author