zsh-workers
 help / color / mirror / code / Atom feed
* menuselect: Different keymap for interactive mode
@ 2011-01-22  3:55 gi1242+zsh
  2011-01-22 19:25 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: gi1242+zsh @ 2011-01-22  3:55 UTC (permalink / raw)
  To: zsh-workers

Hi All,

Is it possible for me to navigate menus with VI keys *AND* disable this
when I'm in interactive mode?

What I'm looking for is to enter menu completion; navigate using h, j,
k, l. Then, press a key (say '/') to enter interactive mode, and type
some search string. The press Escape to return to navigating the menu
(via h, j, k, l). And press Enter when done.

I can use

    bindkey -M menuselect ...

to bind h, j, k, l to the menu movement keys. However, if I do this,
then they retain their meaning when I enter interactive mode! So I can't
use h, j, k, l in a search string.

Is it possible for me to define a new keymap and only use it in
menu completion interactive mode?

Thanks,

GI

-- 
100 THINGS I'D DO IF I EVER BECAME AN EVIL OVERLORD
69. All midwives will be banned from the realm. All babies will be
delivered at state-approved hospitals. Orphans will be placed in
foster-homes, not abandoned in the woods to be raised by creatures of
the wild.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: menuselect: Different keymap for interactive mode
  2011-01-22  3:55 menuselect: Different keymap for interactive mode gi1242+zsh
@ 2011-01-22 19:25 ` Bart Schaefer
  2011-01-22 22:27   ` gi1242+zsh
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2011-01-22 19:25 UTC (permalink / raw)
  To: zsh-workers

On Jan 21, 10:55pm, gi1242+zsh@gmail.com wrote:
}
} Is it possible for me to navigate menus with VI keys *AND* disable this
} when I'm in interactive mode?

Unfortunately, no.  The special keymaps like menuselect and isearch are
not implemented like real keymaps that invoke widgets.  Instead they
are implemented as simple hardwired indirect lookups that happen to use
the set of builtin widget names as the indirection layer between the
typed key and the action, so that bindings can be faked using the same
code that implements real keymaps.

There's no "alternate keymap" available to switch to in this situation;
most of the completion code, including the menu system, was written by
inveterate emacs-mode users, and doubling the work to support vi-like
interaction as well was impractical at the time (and has yet to become
practical, given the trouble we have finding C-coder volunteers for
shell work in general).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: menuselect: Different keymap for interactive mode
  2011-01-22 19:25 ` Bart Schaefer
@ 2011-01-22 22:27   ` gi1242+zsh
  0 siblings, 0 replies; 3+ messages in thread
From: gi1242+zsh @ 2011-01-22 22:27 UTC (permalink / raw)
  To: zsh-workers

On Sat, Jan 22, 2011 at 11:25:09AM -0800, Bart Schaefer wrote:

> }
> } Is it possible for me to navigate menus with VI keys *AND* disable this
> } when I'm in interactive mode?
> 
> Unfortunately, no.

Bummer. Thanks for the explanation,

GI

-- 
100 THINGS I'D DO IF I EVER BECAME AN EVIL OVERLORD
58. If it becomes necessary to escape, I will never stop to pose
dramatically and toss off a one-liner.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-22 22:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-22  3:55 menuselect: Different keymap for interactive mode gi1242+zsh
2011-01-22 19:25 ` Bart Schaefer
2011-01-22 22:27   ` gi1242+zsh

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).