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

Re: implicit previous command, only state what should change



Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> 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



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