From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 37919a82 for ; Thu, 20 Feb 2020 13:30:39 +0000 (UTC) Received: (qmail 23460 invoked by alias); 20 Feb 2020 13:30:32 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24699 Received: (qmail 16968 invoked by uid 1010); 20 Feb 2020 13:30:32 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua1-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25725. spamassassin: 3.4.2. Clear:RC:0(209.85.222.46):SA:0(-2.0/5.0):. Processed in 3.636653 secs); 20 Feb 2020 13:30:32 -0000 X-Envelope-From: pierpaolog@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.222.46 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gJS865w4ZMOrWQWY/6Ag6mFtQqWD8U5xM4xflvp5fpE=; b=C6cP7IdJKzIdbqaDCfytmtDiGU66fxM+qb1uTjip1X86/RypV9AEwp4KL67QXlEJBt N0OmYz60wiDDF9fOuWC9BF5Rv8BcWgigcI/JtT3jsssQa1GH03URV5zactb7FFbDWl6/ OvVOPO1mWo60y+0opDu6WNXK24eRkBe60wo2DQBZi+A/H96d7EnGiPzf8WvKqdX+Xeb4 SesvBQtMpiAuzgEbyj1QSnnHlqanTRwFbg00XsDTeDlSF4o6f0yahWLvUd4J05nceJ01 Ydzpb+UdRc8ysL0BKxhVi89IZ57N8HdsikZJ0ZGdE4XAjvJmbTjcQLyaV6hQfyikg9hr XIzw== X-Gm-Message-State: APjAAAUKZGght/uTVo3W8FqEdyphOtbsCWQaQiLZNYQNrgdaWanmm3by f0nNFU1C1ZQwLbLmfo5bnSIjHr8oPHMhRv9wBh0= X-Google-Smtp-Source: APXvYqxQhKE+4uR/Z2IAm1HkdcmS2DhuIioAXyxywGeKFnuiy294W5FgS/cYfeZFzkdCwD6JUe+/UCnXBr0fnlSME8Q= X-Received: by 2002:ab0:2095:: with SMTP id r21mr4147300uak.129.1582205396393; Thu, 20 Feb 2020 05:29:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pier Paolo Grassi Date: Thu, 20 Feb 2020 14:29:20 +0100 Message-ID: Subject: Re: history expansion To: Vin Shelton Cc: Zsh-Users List Content-Type: multipart/alternative; boundary="0000000000009d2407059f01e605" --0000000000009d2407059f01e605 Content-Type: text/plain; charset="UTF-8" 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@alumni.princeton.edu> 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 > 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@alumni.princeton.edu> 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 >>> 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 >>>> >>> --0000000000009d2407059f01e605--