From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7947 invoked by alias); 14 Sep 2016 07:22:25 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21901 Received: (qmail 3536 invoked from network); 14 Sep 2016 07:22:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.215.44):SA:0(0.0/5.0):. Processed in 0.444842 secs); 14 Sep 2016 07:22:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE, SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: jesper.nygards@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.215.44 as permitted sender) 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=kr10W5fCA1thE+Go8Bnl39eT5aEYuzhiw/S0ntmiNoI=; b=UkJCqOG4Fy91sdr62e9UEmUGKUUuZ9M2ze19e7pbQWWUUz6ES4QLje6fshJMnfwvVh njZwgtP8FLxg3HFHm4W2sauSIle5v4vrnKE49Pz6zsYsOUDymt9YCqKXeiJ9Hzq7QMFZ dmwVqagIT0LSV/jsHgVcsPCACDaTCHwdqM2M9j3JKtQBvJGkfk9IPA8UQ6VXYjPr85RT 52m6a5M2beSqyu4jwYMIO6ZoVi2OXzCSs2v8wqQ/Dx4rGD/VqkhXwqbsroJyU9iNZk+h jtwlFR2KSjz27laliOJIMonwlVJ8IZTyeHzKA2xkNhcBZLFdQQFF3W+nhj6oVPwzAFCL WnHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=kr10W5fCA1thE+Go8Bnl39eT5aEYuzhiw/S0ntmiNoI=; b=lWbJPiOdwoH5lUluOROMfB4O6coIRR6SNLqUvHbgu368Wr9YB20ET9HxDMp6L89dI1 blse2IWL9baRKb6zmNq0j82C11AUO3LeeWTSpS6B/8uQgbb/kmYORHq0+DATAeXyCrQz /vCGUPVfN56YfHWsS8IDxlZmpyA7MSTsp4z9LwZs/PnkRDuq/3Z2iUjBrTtwagPjuGs+ luryQr+dvEqts9sVxw87yqHMSgEl/ty+P2Euc4SdfXCGEEpp2T7WRFrF7QjiVq0NLQwQ OAd804cFPEiUvIenufWOdVobHcVR4YYsagGK2meMcTsxqWkXjDabASyAZcdL4vsXcJd9 Nwog== X-Gm-Message-State: AE9vXwONZ4LXRxD1eJQZg6BZeie9AGivDbygyTGVAW3yBbfZoDl9H014Km6dVAm5ztNvTsOJzFUdIv5Mp253bg== X-Received: by 10.25.155.149 with SMTP id d143mr406683lfe.121.1473837737227; Wed, 14 Sep 2016 00:22:17 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160913195916.ZM30431@torch.brasslantern.com> References: <75335.1473713583@hydra.kiddle.eu> <160913195916.ZM30431@torch.brasslantern.com> From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= Date: Wed, 14 Sep 2016 09:22:16 +0200 Message-ID: Subject: Re: Three questions about a completer To: Zsh Users Content-Type: multipart/alternative; boundary=001a11401fbac8bae8053c7296cd --001a11401fbac8bae8053c7296cd Content-Type: text/plain; charset=UTF-8 Thank you for all your help, Bart and Oliver! I am getting closer: the problem with numeric is now solved with your suggestions, as well as turning off the listing of alternatives. However I still have trouble reversing the menu completion direction. I'll explain what it is I want. I believe you've already understood, but just to make sure: say that I have files A, B and C in my home directory. I type "print ", and "A" is put on the line. I then hit "" again, and the "A" is replaced by "B". If I start over and type "print ", "C" is put on the line. Another "" gives me "B". So the two keybindings work independently: "" gives the list from the beginning, "" from the end. However, this is what is NOT working: I type "print ", and get "A". I hit "" again, and get "B". Now, I hit "" to go back in the list. I expected to get "A" again, but instead "B" remains on the line. It's as though the only thing matching is what's right now on the line. Below is the entirety of my ~/.zshrc when I experiment with this. It's Bart's solution with n-rev-list-comp added (and the compinit activation). autoload -U compinit compinit zle -C list-comp menu-complete _generic zle -C rev-list-comp reverse-menu-complete _generic n-list-comp() { local -a dirs=( $HOME /etc /bin ) local __lsdir=${dirs[${NUMERIC:-1}]} zle list-comp -w -n 1 } n-rev-list-comp() { local -a dirs=( $HOME /etc /bin ) local __lsdir=${dirs[${NUMERIC:-1}]} zle rev-list-comp -w -n 1 } zle -N n-list-comp zle -N n-rev-list-comp bindkey '\ee' n-list-comp bindkey '\eE' n-rev-list-comp _list-result() { compadd -M 'l:|=* m:{[:lower:]}={[:upper:]}' -f ${__lsdir:-HOME}/* compstate[list]='' } zstyle ':completion:*list-comp::::' completer _list-result --001a11401fbac8bae8053c7296cd--