zsh-users
 help / color / mirror / code / Atom feed
From: Andreas Winschu <andrej.wins@gmail.com>
To: zsh-users@zsh.org
Subject: How to expeand zsh compctl completions with same prefix (from z script)?
Date: Wed, 25 Aug 2021 10:25:37 +0200	[thread overview]
Message-ID: <CALmXC6ETh84=TQNN6YqCWuFFAqAnqCARd0RNWpiUs-vC6susaQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

Hello there ,

Can anyone help me with a `compctl` grouping autocomplete entries by prefix
behavior?

I have a zsh setup via .oh-my-zsh.
The z plugin allows to jump to last recently used directories.

When you press `z name<TAB>`  it autocompletes `name` from the list of
recently visited dirs by matching `name` against the list.

https://github.com/ohmyzsh/ohmyzsh/blob/6d5b8484ce7198161d5f617c3db9fd7d3833d48c/plugins/z/z.sh#L250

Sometimes the result contains only a single entry, when i know there should
be multiple. I have debugged the `reply` variable. This issue happens, if
all entries have the same prefix, e.g. `/path/to/dir`, containing dirs with
`name`
In this case there is only the prefix in the autocomplete menu instead of
full list of matched dirs. Hitting `<TAB> `again after expansion, triggers
a new call to `z` script complete function now with the full common prefix
instead of my search query , e.g. `/path/to/dir`

When i press <Shift+Tab> which is bound to `reverse-menu-complete`
`zsh` properly selects the last item and shows the full list.

Is there supposed to be a further keybinding to expand the common prefix
for `compctl` after it grouped all entries with a common prefix?

[-- Attachment #2: Type: text/html, Size: 1451 bytes --]

                 reply	other threads:[~2021-08-25  8:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CALmXC6ETh84=TQNN6YqCWuFFAqAnqCARd0RNWpiUs-vC6susaQ@mail.gmail.com' \
    --to=andrej.wins@gmail.com \
    --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).