Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completion configuration
- X-seq: zsh-users 23498
- From: Arturo Escaip <arturoescaip@xxxxxxxxx>
- To: pierpaolog@xxxxxxxxx
- Subject: Re: completion configuration
- Date: Mon, 18 Jun 2018 15:12:20 -0700
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0nrwcY9w9ejOlBncbeJeUxgFGM6MQnmgcRL6WDe0ZPY=; b=XfvmsC406gCyJOEttz5Ne5ZcGJJAt5Cq94feumjNDMD4O0KU3gyf2Fv8Yk22nnnm5P h733QTx01H5YWCnUlzJrtVrG46fbWKyHWeSmcVP/g4hvd0eiqh7CDsTV0Lesv2I0I9r9 VmJutUHwnHjc8s3/qAjxrgxal2HSjXv674Kf8Tzi0Gjj6RiG3XS/FxjnzyXrXrj5+aES TvMCBStgrhMilpeZv8PFdV7cMrgDyZTdQ0eKCOC74BHPAsZRFZZHCEFPRz201/Dcd6AW ei6A20N4Js8U9ZWfSfo0Cd/k7cC/TiSIL2ZH5u9q6VwAomr4i10tulDbjpny92m1iDgc QP+w==
- In-reply-to: <CAP+y1xC=AvW-Qhd+ntfK6b8jpbm9P6ya-RU=baNfoTwZcSOD3w@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAP+y1xC=AvW-Qhd+ntfK6b8jpbm9P6ya-RU=baNfoTwZcSOD3w@mail.gmail.com>
Hey Pier,
I’m not very knowledgeable about styles, but I think you may have the
context pattern wrong. You can use C-x h to see the context at any point
when writing a command and you can use that output as a guide when building
a pattern for a style. For example, I have a command that I wrote that is
called pb and this is the output I get when I do C-x h right after typing
pb<space>:
~% pb
tags in context :completion::complete:pb::
argument-1 options (_arguments _pb (eval))
The full context is :completion::complete:pb::, I think in your call to
zstyle you are missing the last two colons, so what if you try:
zstyle ':completion:*:approximate:my_command:*' max-errors 0
You don’t need the -e option because you don’t need 0 to be evaluated.
On Mon, Jun 18, 2018 at 2:41 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
wrote:
> Hello everybody, I must confess I don't have a clue when it comes to
> configure completion styles. I made various attempts but for now, I don't
> seem to grasp the syntax of ztyle.
> I have in my .zshrc (blindly copied years ago from who knows where):
>
> zstyle -e ':completion:*:approximate:*' max-errors \
> 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'
>
> that, as I understand, enables approximate match for all the commands when
> trying completion for a number of errors proportional to the number of
> characters of the word to be completed etc.
>
> I would like to disable this completion for a command that has a completer
> function I wrote that pass to compadd various values, since these are so
> many that the completion is very slow to show matches. So I thought that
> maybe disabling the approximate match for this command would speed things
> up.
>
> My best bet doing this was:
> zstyle -e ':completion:*:approximate:my_command' max-errors 0
>
> but this does not work. I tried also various variants to no success.
> Can someone shed some light on this please?
>
> --
> Pier Paolo Grassi
> email: pierpaolog@xxxxxxxxx
> linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
> founder: https://www.meetup.com/it-IT/Machine-Learning-TO
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author