Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: history expansion
- X-seq: zsh-users 30699
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: history expansion
- Date: Tue, 14 Jul 2026 12:35:44 +0200
- Archived-at: <https://zsh.org/users/30699>
- In-reply-to: <CAH+w=7a9mCwLeHxyM-30CkHVEVyLYs68FfAshNzKCOLPTUBQ6g@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- References: <20260712085723.GA719379@qaa.vinc17.org> <AB1505A3-F3EF-4DF2-86A7-D827F6FF6B3A@gmail.com> <CAA=-s3xAjkK1jcQ+zJFqNgF_1xkezLudrnenjttGxoZPMsUf0g@mail.gmail.com> <CAH+w=7a9mCwLeHxyM-30CkHVEVyLYs68FfAshNzKCOLPTUBQ6g@mail.gmail.com>
On 2026-07-12 13:54:15 -0700, Bart Schaefer wrote:
> On Sun, Jul 12, 2026 at 6:42 AM Mark J. Reed <markjreed@xxxxxxxxx> wrote:
> >
> > I use history substitution all the time.
>
> I do as well, because I spend a significant portion of my time using
> bash on virtual hosts where zsh is not installed and it would be
> counterproductive to customize it. Muscle memory for !! et al. is
> more valuable than ZLE (or readline) customization.
Don't you use the same customization on all your machines?
> 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?
Note: I do not think that there is any issue with history expansion
when the input starts with "!" (not followed by a space) as this
would be very unusual for a normal command. My problem was more with
things like
echo "foo!"
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author