Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Three questions about a completer
- X-seq: zsh-users 21891
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Three questions about a completer
- Date: Tue, 13 Sep 2016 18:16:13 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ogRmpP2f7gys2JzQe7k1zejjZ3mEBNzp6DVoE4CyKVs=; b=E2548djPC1uaknHCd8aY097n9KC2OhfTrrjBDSnaLYaHKBJvzgQXZ7BvHpItGoQsih jLuGPGfazGBVKNHosqBirU9zB8ChcYv6eKKMS9xzaEFqcQMi4fq8PhpTtBR4kuR1xdpE 3OHA7q3tW0Eu9JGQuMpKTKVfWCpbm9TBBj4KJJ6xTxUadXud6lDRfwx7somEdBnt2D43 uG4dtTOVLWAFgYIrmK1VPWqZEDFYKVUYDmUXCYbkVU/e0Gk0MLJ/cGCClg5Ai0Z4GG2H QUWlno+n9GdPmA5i5uDUj9Lhp2eWbr01Eg1rp1nwFu2tYuSKiJNCl8/h4nOHjRuUqAvM FHeQ==
- In-reply-to: <75335.1473713583@hydra.kiddle.eu>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg-VR4ss0KpxLvUnrUS7JnTVGGdSWePH7NzCzQvdimMubg@mail.gmail.com> <75335.1473713583@hydra.kiddle.eu>
On Mon, Sep 12, 2016 at 10:53 PM, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
> Jesper Nygårds wrote:
> >Again, I want to put a string on the command line, hit
> > alt-e, and only those files having a part matching what i wrote should be
> > offered. If I then reverse the order, I want the same list, i.e. those
> > files matching what I originally wrote.
>
> Using _menu generally does what I think you're describing. To use that,
> you may want to use _generic instead of _list-result directly. I'd
> recommend using _generic regardless of whether you want _menu, actually.
> Other completers such as _match could also be useful.
>
> zle -C list-comp menu-complete _generic
> zstyle ':completion:*list-comp::::' completer _menu _list-result
>
>
Perhaps I am missing something obvious, but I cannot get this to work. I
tried applying your suggestions, and ended up with this:
_list-result() {
print In _list-result
local -a hlist=($HOME/*)
compadd -n -V list_result -M 'l:|=* m:{[:lower:]}={[:upper:]}' -- $hlist
}
zle -C list-comp menu-complete _generic
zle -C rev-list-comp reverse-menu-complete _generic
zstyle ':completion:*list-comp::::' completer _menu _list-result
bindkey '\ee' list-comp
bindkey '\eE' rev-list-comp
However, something is missing, because completion is not triggered. In
fact, the debugging line "In _list-result" is not printed, so _list-result
is never called. I assume there is something more that I need to put in
place that I have missed?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author