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

Re: _complete: insert unambiguous when globbing



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