From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21361 invoked from network); 9 Jul 2006 15:37:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Jul 2006 15:37:04 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 34484 invoked from network); 9 Jul 2006 15:36:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Jul 2006 15:36:56 -0000 Received: (qmail 12004 invoked by alias); 9 Jul 2006 15:36:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10501 Received: (qmail 11993 invoked from network); 9 Jul 2006 15:36:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Jul 2006 15:36:47 -0000 Received: (qmail 33383 invoked from network); 9 Jul 2006 15:36:47 -0000 Received: from nf-out-0910.google.com (64.233.182.186) by a.mx.sunsite.dk with SMTP; 9 Jul 2006 15:36:46 -0000 Received: by nf-out-0910.google.com with SMTP id o63so245943nfa for ; Sun, 09 Jul 2006 08:36:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=lkxdvYQ2QlWIH1H8pzf1hWsB1F66/R3BW/AP3ZEKEMMH+kxeG+P1aUkQj8J3R1oZzerPQ2QAWFF+X2llbP+2gj0GICJphKMO++lHXR2lDjrzqc3j7agfSXiAJ9vo7KDclnhGx5mTsLAfpMClSTUi0wMsm9Ef7waChId9LZygIe4= Received: by 10.78.156.6 with SMTP id d6mr1364012hue; Sun, 09 Jul 2006 08:36:46 -0700 (PDT) Received: by 10.78.178.20 with HTTP; Sun, 9 Jul 2006 08:36:46 -0700 (PDT) Message-ID: Date: Sun, 9 Jul 2006 17:36:46 +0200 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: "Zsh Users' List" Subject: Re: Is there a way to do an automatic list-choices after successful completion of directory name? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 53fd835524a730ef On 7/7/06, Nikolai Weibull wrote: > I would like list-choices to be run whenever I have completed a > directory name, e.g., > > $ cd ~/p > > completes to > > $ cd ~/projects/ > > Once completed, I'd like list-choices to be called so that I can see > what directories I have under ~/projects immediately, instead of > having to type another right after the first one. Yes, there is in fact a way to do what you want: _expand-or-complete-with-list-choices-after-local-directories () { zle expand-or-complete if [[ $_lastcomp[tags] == ' local-directories ' ]]; then zle list-choices fi } zle -N expand-or-complete-with-list-choices-after-local-directories _expand-or-complete-with-list-choices-after-local-directories bindkey "^I" expand-or-complete-with-list-choices-after-local-directories I'm sure you can come up with a better name for it, but that's what it does... Comments? nikolai