Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: menuselect and history
- X-seq: zsh-users 7387
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: menuselect and history
- Date: Thu, 22 Apr 2004 04:57:17 +0000
- In-reply-to: <20040420160802.12160.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040420160802.12160.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
On Apr 20, 9:08am, Felix Rosencrantz wrote:
}
} As Matthias predicted, this is cool. It would be even cooler if it
} could be connected to the incremental search commands. The list
} presented would be winnowed as the user types the search term.
This might be possible, but it'd be significantly more difficult.
Menu selection just doesn't work that way -- the incremental search
commands scan through the listing, they don't narrow it -- so what
in effect you'd need to do is exit from and restart completion on
every keystroke.
However, given the _history_select function that I posted, you can
do this:
autoload -U incremental-complete-word
zle -N incremental-complete-word
bindkey '^Xi' incremental-complete-word
zstyle :incremental list yes
zstyle ':completion:incremental:*' completer _history_select ...
(where "..." are whatever completers you normally would want to try)
and then when you type C-x i on the command word you should get exactly
what you just asked for, except that you _can't_ also scroll around in
the list of choices.
This does show a bug in incremental-complete-word -- the way that it
computes its prompt pre-dates some changes in the conventions for the
values of the _lastcomp association. (There are likely to be other
outdated things about i-c-w that are problems waiting to happen.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author