Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: history expansion
- X-seq: zsh-users 24699
- From: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- To: Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: history expansion
- Date: Thu, 20 Feb 2020 14:29:20 +0100
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- In-reply-to: <CACeGjnX=weLLEp6q4nOur-2U6YfU4E8sxBvmvwyDuZcJ30FDEA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAP+y1xA-Pm1-kiuvODNHRteGAEbOOA7PDqR6mYF+v-hvBYiCZA@mail.gmail.com> <CACeGjnUZ_UJAqm=xZbN5Gof+G8M-Y9zATf433FSApV=avp5G1g@mail.gmail.com> <CAP+y1xB3=zPcUhd_qJ3nDBPvx8XOoHPqDn0Btby-r=bBpoOVEg@mail.gmail.com> <CACeGjnX=weLLEp6q4nOur-2U6YfU4E8sxBvmvwyDuZcJ30FDEA@mail.gmail.com>
something like an alias that could allow me to reuse history expandable
expressions, such as !!, !:1, ^cdcd^cddcd and so on
Pier Paolo Grassi
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO
Il giorno gio 20 feb 2020 alle ore 14:27 Vin Shelton <
acs@xxxxxxxxxxxxxxxxxxxx> ha scritto:
> I still do not understand: what do you want to do? Do you want to create
> an alias that modifies the history expansion in some particular way?
>
> - Vin
>
> On Thu, Feb 20, 2020 at 8:19 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
> wrote:
>
>> Hi Vin, it does not because:
>>
>> 20-02-20 14:16:45 root@bakeca-vivobook Path: ~
>> : print -z '!!'
>> 20-02-20 14:16:47 root@bakeca-vivobook Path: ~
>> : !!
>> print -z '!!'
>>
>> !! is resolved to print -z '!!'
>> If I had used it like you did, as !! unquoted, it would not be aliasable,
>> so I would incur in my original problem
>> thanks
>>
>> Pier Paolo Grassi
>> linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
>> founder: https://www.meetup.com/it-IT/Machine-Learning-TO
>>
>>
>> Il giorno gio 20 feb 2020 alle ore 14:06 Vin Shelton <
>> acs@xxxxxxxxxxxxxxxxxxxx> ha scritto:
>>
>>> I'm not sure I understand what you mean. Does
>>>
>>> print -z !!
>>>
>>> do what you want? Perhaps you want to try out other batch substitutions
>>> (e.g. "!:1") before you use "print -z", which enables interactive editing.
>>>
>>> HTH,
>>> Vin
>>>
>>> On Thu, Feb 20, 2020 at 7:46 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
>>> wrote:
>>>
>>>> hello, history expansion is quite the powerful syntax for re-executing
>>>> commands from history with various functionalities for automatic
>>>> transformation. Since it happens before alias expansion it is not
>>>> possibile
>>>> to simplify the access to these functionalities though, and one have to
>>>> remember and type every time the right syntax, and in case of error you
>>>> have to type everything again.
>>>> Is that it or am I missing some way to reuse it?
>>>> I have just thought of a custom widget that could add to $BUFFER a
>>>> history
>>>> command of one's choice, are there other ways?
>>>>
>>>> Pier Paolo Grassi
>>>> linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
>>>> founder: https://www.meetup.com/it-IT/Machine-Learning-TO
>>>>
>>>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author