From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29574 invoked from network); 7 Mar 2000 15:34:13 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Mar 2000 15:34:13 -0000 Received: (qmail 25589 invoked by alias); 7 Mar 2000 15:33:31 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2957 Received: (qmail 25575 invoked from network); 7 Mar 2000 15:33:30 -0000 From: mkkwong@lucent.com Original-From: kwong@marconi.ih.lucent.com Message-Id: <200003071533.JAA02588@w-kwong.ih.lucent.com> Subject: Re: some directory changing tools to share To: zefram@fysh.org (Zefram) Date: Tue, 7 Mar 2000 09:33:09 -0600 (CST) Cc: mkkwong@lucent.com, zsh-users@sunsite.auc.dk In-Reply-To: from "Zefram" at Mar 07, 2000 12:32:34 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit zefram, Thank you very much for your interest and comments. I am aware that completion does some of what "c" does, but perhaps not "most". The real potential of "c" is not in simply moving down the subdirectory tree from the current directory, but to jump to another directory and then move down from there, namely, the use of aliases, such as "P t g" to go to ~/Perl/Test/Gui or in combination with the "d" operator. mk > > mkkwong@lucent.com wrote: > >non-directory filenames that also begins with "Le" (you can get around one > >of the problems by redefining the completion rules for "cd"). > > Actually most of what your "c" function does can be done with completion > in zsh. The standard completion for cd only completes to names of > directories anyway. With > > zstyle ':completion:*:cd:*' matcher-list 'm:{A-Z}={a-z}' > > completion on cd is one-way case insensitive, the way you want it. > With menu completion, you can have the lexically first match inserted > straight away (or with AUTO_MENU on the second or third tab), so you don't > even have to type an unambiguous prefix. Continuing menu completion, > you can get to matches other than the lexically first, still without > typing an unambiguous prefix. And the big advantage of completion over > your functions is that if you make a mistake, you can see it before > actually executing the command. > > >Using my tool, you just type > > > > c l > > With MENU_COMPLETE and the zstyle noted above, "cd l". If you use > AUTO_CD, you can actually drop the "cd " part. > > >Rule 1 works recursively down the directory tree one level at a time, with > >unlimited depth. > > Same for completion. It'll add a trailing "/" to any complete match > it inserts, after which you can press tab again to complete the next > level down. If in the middle of menu completion, and you don't want > to type any actual letters, type the "/" yourself to break out of menu > completion and then tab will start completion at the next level. > > > c p t g > > > >takes you all the way to Perl/Test/Gui. > > "cd ptg". > > > ch (c ~) jumps to home directory > > "cd" without arguments does this. > > > c. (c ..) jumps to parent directory (similarly c.. c...) > > I just type "..". (I have AUTO_CD set.) > > > alias co='c $OFC' > > alias ct='c $TST' > > alias dev='c $DEV' > > I find it useful in these cases to refer to "~OFC" etc. This means > that the current directory in my prompt (a "%~" sequence) will use these > names to shorten the directory specification. Completion works perfectly > happily after either "$FOO" or "~FOO". > > -zefram >