From: Emanuel Berg <embe8573@student.uu.se>
To: zsh-workers@zsh.org
Subject: Re: implicit previous command, only state what should change
Date: Mon, 14 Jul 2014 00:50:33 +0200 [thread overview]
Message-ID: <87sim427ra.fsf@debian.uxu> (raw)
In-Reply-To: <87sim4lwxk.fsf@ft.bewatermyfriend.org> (Frank Terbeck's message of "Mon, 14 Jul 2014 00:24:07 +0200")
Frank Terbeck <ft@bewatermyfriend.org> writes:
>> $ grep user-home-directory *.el
>>
>> After that, I realize that it should have been
>> `user-emacs-directory'.
>>
>> Is there a way to tell zsh to "execute the previous
>> command again, only substitute the first argument for
>> user-emacs-directory"? Like
>>
>> $ !!:1->user-emacs-directory
>
> Like this:
>
> % ^-home-^-emacs-
I seems that is substitution of the first match sort of
like the sed substitution command without the g option,
which actually for this example is much better than my
suggestion (because only part of the argument is
incorrect), so it is great to know, yes.
Still, one can imagine a case when the whole argument
is wrong, and for a long argument it would be better to
just be able to refer to it and state the replacement.
I tried ^!:1^replacement but that wasn't it.
--
underground experts united
next prev parent reply other threads:[~2014-07-13 22:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-13 22:06 Emanuel Berg
2014-07-13 22:24 ` Frank Terbeck
2014-07-13 22:50 ` Emanuel Berg [this message]
2014-07-14 2:08 ` Mikael Magnusson
2014-07-14 13:09 ` Emanuel Berg
2014-07-15 6:46 ` Bart Schaefer
2014-07-15 15:42 ` Emanuel Berg
2014-07-15 16:58 ` Peter Stephenson
2014-07-16 0:36 ` Emanuel Berg
2014-07-16 13:54 ` Peter Stephenson
2014-07-16 20:45 ` Emanuel Berg
2014-07-16 20:53 ` Bart Schaefer
2014-07-16 21:08 ` Emanuel Berg
2014-07-17 8:17 ` Peter Stephenson
2014-07-17 13:01 ` Emanuel Berg
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=87sim427ra.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--cc=zsh-workers@zsh.org \
/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).