zsh-users
 help / color / mirror / code / Atom feed
From: Roman Neuhauser <neuhauser@bellavista.cz>
To: zsh users <zsh-users@sunsite.dk>
Subject: Re: history expansion
Date: Thu, 26 Sep 2002 12:12:24 +0200	[thread overview]
Message-ID: <20020926101224.GA30361@freepuppy.bellavista.cz> (raw)
In-Reply-To: <1020925234333.ZM6021@candle.brasslantern.com>

# 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/<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


  reply	other threads:[~2002-09-26 10:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-25 10:33 Roman Neuhauser
2002-09-25 23:43 ` Bart Schaefer
2002-09-26 10:12   ` Roman Neuhauser [this message]
     [not found]     ` <20465.1033036099@csr.com>
2002-09-26 17:05       ` Bart Schaefer
2002-09-26 17:32         ` Roman Neuhauser
  -- strict thread matches above, loose matches on Subject: below --
2020-02-20 12:44 Pier Paolo Grassi
2020-02-20 13:05 ` Vin Shelton
2020-02-20 13:19   ` Pier Paolo Grassi
2020-02-20 13:25     ` Vin Shelton
2020-02-20 13:29       ` Pier Paolo Grassi
2020-02-20 15:25         ` Mikael Magnusson
2020-02-20 15:31           ` Pier Paolo Grassi
2020-02-21 22:50             ` gi1242+zsh
2020-02-22  0:21               ` Pier Paolo Grassi
2020-02-22  0:36     ` Bart Schaefer
2020-02-22  1:01       ` Pier Paolo Grassi
2002-04-30 16:33 Roman Neuhauser
2002-04-30 16:43 ` Bart Schaefer
2002-05-06 12:51   ` Roman Neuhauser
2002-05-06 12:43     ` Borsenkow Andrej
2002-05-06 13:11       ` Roman Neuhauser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020926101224.GA30361@freepuppy.bellavista.cz \
    --to=neuhauser@bellavista.cz \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).