zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-users@zsh.org
Cc: joe M <joe9mail@gmail.com>
Subject: Re: Zsh completion configuration LISTMAX
Date: Tue, 26 Feb 2013 19:10:19 +0100	[thread overview]
Message-ID: <14666.1361902219@thecus.kiddle.eu> (raw)
In-Reply-To: <130226092253.ZM4673@torch.brasslantern.com>

Bart wrote:
> If you actually want to eliminate some of the possible matches so that
> the list itself is shorter, you either need to reduce the number of
> words passed to compadd [difficult in general but possibly doable in
> a custom function like the _history_or_autocd example] or play with the
> tag-order / group-order styles to limit the sets of matches displayed.
> 
> Others may have additional suggestions ...

There is also the hidden style which prevents certain matches from
appearing in the list. So for example, you might do the following to not
list usernames after ssh (but still complete them).
  zstyle ':completion:*:ssh:*:users' hidden true

The style corresponds to compadd's -n option.

The nearest I can quickly get to limiting matches would be something
like:
  zstyle -e ':completion:*' hidden '(( compstate[nmatches] > 10 )) && reply=( true )'
That will not result in a maximum of 10 matches being listed, however
because the style is checked for groups of matches not individual ones.
It also doesn't discern between matches by their length.

It's probably better to combine the hidden style with tag-order and
ignored-patterns.

Oliver


      reply	other threads:[~2013-02-26 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26  8:20 joe M
2013-02-26 17:22 ` Bart Schaefer
2013-02-26 18:10   ` Oliver Kiddle [this message]

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=14666.1361902219@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=joe9mail@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).