Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: history expansion
- X-seq: zsh-users 5391
- From: Roman Neuhauser <neuhauser@xxxxxxxxxxxxx>
- To: zsh users <zsh-users@xxxxxxxxxx>
- Subject: Re: history expansion
- Date: Thu, 26 Sep 2002 12:12:24 +0200
- In-reply-to: <1020925234333.ZM6021@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020925103319.GC30361@xxxxxxxxxxxxxxxxxxxxxxx> <1020925234333.ZM6021@xxxxxxxxxxxxxxxxxxxxxxx>
# schaefer@xxxxxxxxxxxxxxxx / 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/<TAB><C-a>!!:s/<RET>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author