Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Quote of % in a completed func name?



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