Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Better way to execute commands from history?
- X-seq: zsh-users 14334
- From: sam reckoner <sam.reckoner@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: Better way to execute commands from history?
- Date: Wed, 2 Sep 2009 16:11:29 -0700
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=P3mOIDJNqmwME6w2n4ebHz1xSgLVIjdTl2mtQoumrAI=; b=x0XKrD94M7eueJnSESE+1BeRvNaQrsWYi8QI1reBlpT+jGK8ofzEptyo8EYRPm0ImF ra/sQRiwI7tBOEd8dUI8V9eQaj4ouxrtJQxemxTccqbB713l5eqLB90BeWfJW9ASbjo/ H2nWrfbDrcQUIr/+7GK9ZXar42d3v+AFmhrYQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=c+He+0QE/SM+vJ9NRmbCXVSdF47f3a6QSpMdYshh3xBN6Zj02hCT/aeDLtPreRx2W3 6QV7t4pRKY9IUsajnKX6cj0UXFcKwrEW5l9xfSU7g+leAragtN4sHgz6Yi4BYRn0X1TT 1uB1BIgB+Z2mJINJLmsldHHMk8V+OzAkYQkCA=
- In-reply-to: <237967ef0909021324m6e4b06cbw5bd9c3ae82f35568@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6a42eec70909021254p62849de5r2c53d7f29fec3f07@xxxxxxxxxxxxxx> <237967ef0909021324m6e4b06cbw5bd9c3ae82f35568@xxxxxxxxxxxxxx>
Thanks for your reply. What version are you referring to?
I have:
%zsh --version
zsh 4.3.4 (i686-pc-cygwin)
thanks!
On Wed, Sep 2, 2009 at 1:24 PM, Mikael Magnusson<mikachu@xxxxxxxxx> wrote:
> 2009/9/2 sam reckoner <sam.reckoner@xxxxxxxxx>:
>> Hi,
>>
>> I am in the habit of doing the following:
>>
>> % fc -l -1000| grep -i cd | grep -i link | tail -1 | cut -d" " -f3
>>
>> which gives me the number of the command that contains both "cd" and
>> "link" in it. I then manually type in
>>
>> % !num
>>
>> where num is the output of the first command. I know there is a C-R
>> command, but doing it as above makes it possible to search the entire
>> string in the history list for multiple items.
>>
>> I'm sure there's a better way to do this.
>
> If you rebind ^R (and ^[^R) to history-incremental-pattern-search-forward
> (the default is without the "pattern-"), you can press ^R and type cd*link
> to get the same result, but you can iterate backwards as usual too.
>
> bindkey "^R" history-incremental-pattern-search-backward
> bindkey "^[^R" history-incremental-pattern-search-forward
>
>
> --
> Mikael Magnusson
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author