zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Tomasz Pala <gotar@polanet.pl>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: _complete: insert unambiguous when globbing
Date: Wed, 5 Jan 2022 12:11:54 -0800	[thread overview]
Message-ID: <CAH+w=7Z_iezjS6QngRPAKyy63-J7q535DWV=-5fEw9xiVcLhNw@mail.gmail.com> (raw)
In-Reply-To: <20220105194643.GA13958@polanet.pl>

On Wed, Jan 5, 2022 at 11:46 AM Tomasz Pala <gotar@polanet.pl> 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.


  reply	other threads:[~2022-01-05 20:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 12:39 Tomasz Pala
2022-01-03 15:40 ` Tomasz Pala
2022-01-04  0:25 ` Bart Schaefer
2022-01-05 19:46   ` Tomasz Pala
2022-01-05 20:11     ` Bart Schaefer [this message]
2022-01-06  1:52       ` Tomasz Pala
2022-01-06 10:38         ` Tomasz Pala
2022-01-05 20:15     ` Tomasz Pala
2022-01-05 20:25       ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Z_iezjS6QngRPAKyy63-J7q535DWV=-5fEw9xiVcLhNw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=gotar@polanet.pl \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).