From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2368 invoked from network); 26 Sep 2002 10:13:24 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Sep 2002 10:13:24 -0000 Received: (qmail 9528 invoked by alias); 26 Sep 2002 10:13:00 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5391 Received: (qmail 9514 invoked from network); 26 Sep 2002 10:12:59 -0000 Date: Thu, 26 Sep 2002 12:12:24 +0200 From: Roman Neuhauser To: zsh users Subject: Re: history expansion Message-ID: <20020926101224.GA30361@freepuppy.bellavista.cz> Mail-Followup-To: zsh users References: <20020925103319.GC30361@freepuppy.bellavista.cz> <1020925234333.ZM6021@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1020925234333.ZM6021@candle.brasslantern.com> User-Agent: Mutt/1.5.1i # schaefer@brasslantern.com / 2002-09-25 23:43:33 +0000: > On Sep 25, 12:33pm, Roman Neuhauser wrote: > } Subject: history expansion > } > } is there a setopt (or another way) that would allow me to do stuff like > } this: > } > } % !!:s/!!3/!-2:s,foo,bar,/ > } > } without the need to use variables? > > So what you want to do is, take the entire line from two commands earlier, > do a foo -> bar replacement in that, and then use that as the replacement > for the third argument of the immediately preceding command? in this example, yes. > I'd type C-p C-a M-f M-f M-f M-d !-2:s,foo,bar, and hit enter. that's what i'm trying to avoid. i'm a history expansion junkie. > There isn't any option or other setting that allows history expansions > to be nested in that way. that's a pitty. > The best you can do is to expand each reference as you go along, by > using magic-space or a completion binding; e.g. the above could be > obtained by typing something like > > !!3/!-2:s,foo,bar/!!:s/ hmm. that's pretty unintuitive for me. not knowing the internals of the history expansion, what is the probability of nested expansion appearing in zsh? -- begin 666 nonexistent.vbs FreeBSD 4.7-RC 12:04PM up 8 days, 19:19, 21 users, load averages: 0.01, 0.04, 0.01 end