Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: suffix alias on a generated file name
- X-seq: zsh-users 24568
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: suffix alias on a generated file name
- Date: Tue, 17 Dec 2019 10:14:34 +0000
- In-reply-to: <XnsAB28662C45EF4davidrayninfocouk@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> <20191216035801.doeloio2cwauxguj@tarpaulin.shahaf.local2> <XnsAB28662C45EF4davidrayninfocouk@195.159.176.226>
zzapper wrote on Tue, 17 Dec 2019 10:02 +00:00:
> Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote in
> news:20191216035801.doeloio2cwauxguj@tarpaulin.shahaf.local2:
>
> > 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?
> >> >
>
> > 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)
> >
> Daniel nothing seems to work I think there must be something 'funny' about
> the way a suffix alias works i.e it must be the first thing that the shell
> sees.
Aliases _are_ parsed very early (see zshexpn(1) near the top), but zle
widgets run even earlier than that, before the command-line is parsed at
all.
What the example code does is change the meaning of pressing
<Enter> so it's like pressing <Tab><Enter>. That's what you wanted to
do, isn't it?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author