Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _complete: insert unambiguous when globbing
- X-seq: zsh-users 27451
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Tomasz Pala <gotar@xxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: _complete: insert unambiguous when globbing
- Date: Wed, 5 Jan 2022 12:11:54 -0800
- Archived-at: <https://zsh.org/users/27451>
- In-reply-to: <20220105194643.GA13958@polanet.pl>
- List-id: <zsh-users.zsh.org>
- References: <20220103123903.GA20434@polanet.pl> <CAH+w=7YobgajzubM-nhbr39cHUn=WcaKMG4oXRkZiorWgdvbjg@mail.gmail.com> <20220105194643.GA13958@polanet.pl>
On Wed, Jan 5, 2022 at 11:46 AM Tomasz Pala <gotar@xxxxxxxxxx> wrote:
>
> I did some digging and I think I've found a solution for my usecase:
>
> +if [[ $PREFIX = *'*'* ]]; then
> + compstate[pattern_insert]=not_menu
> +else
> + compstate[old_list]=keep
> +fi
Aha! That's given me the answer.
You want something along the lines of:
unsetopt globcomplete
zstyle ':completion:*' completer _complete _match _expand
zstyle ':completion::match:*' insert-unambiguous true
The use of insert-unambiguous will set compstate[pattern_insert]
correctly for you. You might also try the value "pattern" for that
zstyle.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author