Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: history expansion



On Tue, Jul 14, 2026 at 3:42 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> Don't you use the same customization on all your machines?

I do a lot of work on auto-scaled cloud instances, it's not practical
to install zsh and export configuration to them.

> > Even though the contributed replace-string function exists, using it
> > doesn't save many keystrokes over !!:gs/foo/bar ... and oddly it
> > doesn't default to acting on the immediately previous command line the
> > way replace-argument does.
>
> How do you use this? Doesn't !!:gs/foo/bar occur at the beginning
> of the line?

Yes, !!:gs is at the beginning of the line.  Sometimes it's something
like !-2:gs, but more rarely it's !*:gs where a new command name is
the first word on the line.

> My problem was more with things like
>
>   echo "foo!"

You probably know this: history expansion takes place inside "..." but
not inside '...'.




Messages sorted by: Reverse Date, Date, Thread, Author