Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bash-like PgUp/PdDown reverse search?
- X-seq: zsh-users 11798
- From: "Anonymous bin ich" <ichbinanon@xxxxxxxxx>
- To: "zsh users" <zsh-users@xxxxxxxxxx>
- Subject: Re: Bash-like PgUp/PdDown reverse search?
- Date: Sat, 25 Aug 2007 01:43:52 +0200
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kTxDZcbQl+JnxLYozfWTVSaRAZdcLCmnKFa68kWHbUOKJVl+8GkFYnpfBJxytBG0smCSRl6UUjiYv5Snnitim8VvV0HacSBG6Ee7NANOD+dBllB1+USTCYlhsJm7JDprSe1rMlZ0oBE8Z2bHyzO786dN4YKSrcryuGebwMW15wQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SnwtknKt1EIXZ3OmCl2nUyDiaLmf8DdwqF9SE1NO8UlSGBOGgI0mUPFbDGMECNqMjSnctoKPg3HwepiCQHt3zMtkGe31XcIUVjeuRU8SfH+ivE3ZSwHo4/utyQJU89FbVMWAmS72GMCAIagWEUqb/t65+j6zS78n2GiqqbQPKnQ=
- In-reply-to: <20070824171342.GA3794@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2d460de70708241001t59382ae6j3dc201de7d3ca899@xxxxxxxxxxxxxx> <200708241706.l7OH6gXe032329@xxxxxxxxxxxxxx> <20070824171342.GA3794@xxxxxxxxxxxxxxxx>
On 8/24/07, Dan Nelson <dnelson@xxxxxxxxxxxxxxx> wrote:
> In the last episode (Aug 24), Peter Stephenson said:
> > "Richard Hartmann" wrote:
> > > I have been unable to make PgUp / PgDown act like Bash's
> > > reverse search. I.e., you enter some string and then press
> > > PgUp / PgDown to search for commands that start with this
> > > string.
> >
> > bindkey '^[[5~' history-beginning-search-backward
> > bindkey '^[[6~' history-beginning-search-forward
> >
> > Use "read" with no arguments to verify that's what your PageUp and
> > PageDown are sending; hit ^C to exit.
>
> I use a helper function in my zshrc to set up all my bindings:
>
> # usage: bindtc <cap> <default> <zsh-command>
> bindtc ()
> {
> setopt localoptions
> local keyval=$(echotc "$1" 2>&-)
> [[ $keyval == "no" ]] && keyval=""
> bindkey "${keyval:-$2}" "$3"
> }
>
> # Bindings for PGUP, PGDN, HOME, END
> bindtc kP "^[[I" history-beginning-search-backward
> bindtc kN "^[[G" history-beginning-search-forward
> bindtc kh "^[[H" beginning-of-line
> bindtc kH "^[[F" end-of-line
>
> --
> Dan Nelson
> dnelson@xxxxxxxxxxxxxxx
>
For those using zkbd:
source ~/.zkbd/$TERM-$VENDOR-$OSTYPE
[[ -n ${key[PageUp]} ]] && bindkey "${key[PageUp]}"
history-beginning-search-backward
[[ -n ${key[PageDown]} ]] && bindkey "${key[PageDown]}"
history-beginning-search-forward
--
Regards,
Messages sorted by:
Reverse Date,
Date,
Thread,
Author