From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5648 invoked from network); 29 Oct 1998 15:34:25 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Oct 1998 15:34:25 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id KAA12051; Thu, 29 Oct 1998 10:25:39 -0500 (EST) Resent-Date: Thu, 29 Oct 1998 10:25:29 -0500 (EST) From: "Michael Barnes" Message-ID: <19981029102918.B558@mibarnes.lib.vt.edu> Date: Thu, 29 Oct 1998 10:29:18 -0500 To: zsh-users@math.gatech.edu Subject: Re: Completion of cd type functions? Mail-Followup-To: zsh-users@math.gatech.edu References: <9810299096.AA909663631@smtp-gw.jeppesen.com> <9810291323.AA28218@ibmth.df.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1 In-Reply-To: <9810291323.AA28218@ibmth.df.unipi.it>; from Peter Stephenson on Thu, Oct 29, 1998 at 02:23:38PM +0100 Resent-Message-ID: <"K-o0_.0.dx2.dZ8Es"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1894 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Or just do: cxx=$HOME/development/source/cxx/ compctl cd -g '*(-/)' and then just do: cd ~cxx/ Note: this works with 3.0.x dont know about 3.1.x I would assume this behaviour has not changed. Michael Barnes On Thu, Oct 29, 1998 at 02:23:38PM +0100, Peter Stephenson wrote: > "G. Khalsa" wrote: > > alias cxxsrc 'cd ~/development/source/cxx/\!*' > > complete cxxsrc "p@1@D:$HOME/development/source/cxx@" > > > > This way I can just type cxxsrc from anywhere and have it complete only with > > directories in $HOME/development/source/cxx. > > > > Can I do this somehow in zsh (simply)? > > In zsh 3.1, you need > > cxxsrc() { cd ~/development/source/cxx/$1; } > compctl -W ~/development/source/cxx -/ cxxsrc > > In older versions it's harder, particularly to get subdirectories. > You need to write a completion function which sticks the appropriate > part in front of the word so far, lists the directories that are > there, then deletes the front part of the word again and returns the > result; plus it still doesn't work as a path since in lists you get > the whole word, not just the last part of the path. > > > Unfortunately the lete2ctl script fails when I try to run it so I can't get a > > ll > > my nifty tcsh completions translated automatically. > > The supplied version doesn't go down too well with recent versions of > perl. There's a new version of lete2ctl for 3.1, which should appear > soon. It doesn't handle the 'D' code since that doesn't appear in any > of the tcsh manuals I have access to. > > -- > Peter Stephenson Tel: +39 050 844536 > WWW: http://www.ifh.de/~pws/ > Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy