Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion of cd type functions?
- X-seq: zsh-users 1894
- From: "Michael Barnes" <mibarnes@xxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Completion of cd type functions?
- Date: Thu, 29 Oct 1998 10:29:18 -0500
- In-reply-to: <9810291323.AA28218@xxxxxxxxxxxxxxxxx>; from Peter Stephenson on Thu, Oct 29, 1998 at 02:23:38PM +0100
- Mail-followup-to: zsh-users@xxxxxxxxxxxxxxx
- References: <9810299096.AA909663631@xxxxxxxxxxxxxxxxxxxx> <9810291323.AA28218@xxxxxxxxxxxxxxxxx>
Or just do:
cxx=$HOME/development/source/cxx/
compctl cd -g '*(-/)'
and then just do:
cd ~cxx/<TAB>
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 <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
> WWW: http://www.ifh.de/~pws/
> Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author