Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Quote of % in a completed func name?
- X-seq: zsh-users 29264
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Quote of % in a completed func name?
- Date: Mon, 18 Sep 2023 07:56:04 -0700
- Archived-at: <https://zsh.org/users/29264>
- In-reply-to: <CAKc7PVDphx+Nsrkc+i0pCwyK=gZQh4NCpUYBxtEMYzoKcq-GFw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAKc7PVDphx+Nsrkc+i0pCwyK=gZQh4NCpUYBxtEMYzoKcq-GFw@mail.gmail.com>
On Mon, Sep 18, 2023 at 6:42 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Could the % be somehow be quoted after completing? (\%exa works and calls the %func functon)
Firstly, to prevent conflicts you can remove "jobs" from the same
completion zstyle I sent earlier for leading colons in command
completion.
For command execution, you're probably best going with a
zle-line-finish hook that does a search-and-replace, e.g.
BUFFER=${(*)BUFFER//#%(#b)(${(kj:|:)~functions[(I)%*]})/\\\\$match[1]}
(remove (*) and setopt extendedglob for older zsh)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author