Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: suffix alias on a generated file name
- X-seq: zsh-users 24554
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: suffix alias on a generated file name
- Date: Mon, 16 Dec 2019 03:58:01 +0000
- In-reply-to: <XnsAB26A6337DC1Ddavidrayninfocouk@195.159.176.226>
- 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: <XnsAB2489C6C6331davidrayninfocouk@195.159.176.226> <20191214111751.ot4jd3o5esekqyfb@tarpaulin.shahaf.local2> <XnsAB26A6337DC1Ddavidrayninfocouk@195.159.176.226>
zzapper wrote on Sun, Dec 15, 2019 at 16:20:16 -0000:
> Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author