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=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 a4251276 for ; Mon, 16 Dec 2019 03:58:45 +0000 (UTC) Received: (qmail 2172 invoked by alias); 16 Dec 2019 03:58:38 -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: 24554 Received: (qmail 28917 invoked by uid 1010); 16 Dec 2019 03:58:38 -0000 X-Qmail-Scanner-Diagnostics: from wout1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(64.147.123.24):SA:0(-2.6/5.0):. Processed in 0.699143 secs); 16 Dec 2019 03:58:38 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtgedgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujggfsehttd dttddtredvnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucfkphepjeelrddukedtrdehjedrudduleenuc frrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgr mhgvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Date: Mon, 16 Dec 2019 03:58:01 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: Re: suffix alias on a generated file name Message-ID: <20191216035801.doeloio2cwauxguj@tarpaulin.shahaf.local2> References: <20191214111751.ot4jd3o5esekqyfb@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) zzapper wrote on Sun, Dec 15, 2019 at 16:20:16 -0000: > Daniel Shahaf wrote in > news:20191214111751.ot4jd3o5esekqyfb@tarpaulin.shahaf.local2: > > > >> BUT how do I do that without the manual TABing? > > > > What's wrong with > > > > alias NF='gvim *.txt(.om[1])' > > > > ? > > > > > That would be a work-around but what I'm looking for is more generic > solution perhaps useful for other situations i.e. having generated a > filename or command to re-present it to the shell so that I can in this > case apply a suffix alias. I suppose you could wrap the accept-line widget to perform expansion: accept-line() { zle expand-word; zle .accept-line -- "$@" zle -N accept-line (untested) You could even make it perform repeated expansions until $BUFFER doesn't change.