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

Re: history-incremental-search-backward with a twist

On Sep 29,  1:41am, Bart Schaefer wrote:
} Presuming you have 4.0.x, this is ridiculously easy ...

Except that I forgot about the silly problem with repeating the keystroke;
the "minibuffer" doesn't really have a "keymap", so you have to name the
widget the right thing.  Like so:

    function beginning-incremental-search {
	if [[ $LASTWIDGET == $WIDGET ]]
	then zle .$WIDGET
	else zle .$WIDGET $LBUFFER

    zle -N history-incremental-search-backward beginning-incremental-search
    zle -N history-incremental-search-forward beginning-incremental-search

Which means you can't use the old history-incremental-search-* any more if
you want this variant to work.

Note to zsh-workers:  We really need to get real keymaps in there.  It
shouldn't even be very difficult any more, at least in the -dev version.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

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