zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh hackers list <zsh-workers@zsh.org>
Cc: Hong Xu <hong@topbug.net>
Subject: Re: Feature request: readline's completion-prefix-display-length option
Date: Thu, 02 Jun 2016 13:28:35 +0000	[thread overview]
Message-ID: <20160602132835.GA32034@tarsus.local2> (raw)
In-Reply-To: <20160519211427.GA11264@tarsus.local2>

Daniel Shahaf wrote on Thu, May 19, 2016 at 21:14:27 +0000:
> Bart Schaefer wrote on Sun, May 15, 2016 at 04:50:50 -0700:
> > On Sat, May 14, 2016 at 11:08 PM, Hong Xu <hong@topbug.net> wrote:
> > >
> > > I believe that readline's completion-prefix-display-length is a great
> > > option to have for zle. This option enables the common part of long
> > > completions to be represented by ellipsis, so the options in the
> > > completion list would not be too long in many cases.
> > 
> > There might be a deviously clever way to do this with the list-colors
> > style, similar to the way that show-ambiguity is implemented.
> 
> Like this?

I've added a guard and made minor tweaks:

if [[ $'\e\x5b3D' == "$(echoti cub 3)" ]] &&
   [[ $'\e\x5b33m' == "$(echoti setaf 3)" ]]; then
  zstyle -e ':completion:*' list-colors $'reply=( "=(#b)(${(b)PREFIX})(?)([^ ]#)*=0=0=${PREFIX:+${#PREFIX}D${(l:$#PREFIX:: :):-…}\e\x5b}34=33" )'
fi
zstyle ':completion:*:*(directories|files)*' list-colors ''


  reply	other threads:[~2016-06-02 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-15  6:08 Hong Xu
2016-05-15 11:50 ` Bart Schaefer
2016-05-19 21:14   ` Daniel Shahaf
2016-06-02 13:28     ` Daniel Shahaf [this message]
2016-05-19 21:14   ` Daniel Shahaf
2016-06-02  5:42     ` 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=20160602132835.GA32034@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=hong@topbug.net \
    --cc=zsh-workers@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).