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

Re: More local keymaps?



Andrej Borsenkow wrote:

> I currently have Alt-RETURN (actually, ESC-RETURN) bound to
> accept-and-menu-complete. That's fine and nice ... but after last patches it
> seems quite wasteful. There are much more places where I'd like to use these
> keys ... and I have to reserve it for very special single case.
> 
> What about local keymap for normal menu completion (menucomplete?) It looks
> logical - most widgets you'd like to use cannot be used outside of menu
> completion in any case. And binding cup -> menu-complete and cdown ->
> rverse-menu-complete would give you nice way to scroll through matches even
> without menu select.

Problem is that currently local keymaps are realy very very local ;-)
As soon as we fall back into the main key-read-loop, the local keymap
is removed (in fact, widgets installing a local keymap should remove
it).
However, I agree, that it would be nice to (be able to) do more with
local maps. This menu-completion thing is one (small problem: you
don't get any visual feedback when menucompletion is started or
exited). The vared-option I mentioned is another one. And I would also 
like to add (initially empty) maps for isearch, execute-named-command
and the other builtin widgets which have their own key-loop.

> Releated question: how useful would local keymaps be for user defined widgets?
> It differs from current 'bindkey -N newkeymap xxx; bindkey -A newkymap main' in
> two aspects:

Only if we add a way to read a key sequence (and get the widget name
as the result). But that may be interesting to have anyway... (so that 
you can implement real key-loops in shell code).

>  - it is sparse (is it really?) You do not need to define all possible bindings

Yes, really. Look at complist, it defines only a couple of keys.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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