zsh-users
 help / color / mirror / code / Atom feed
From: mkkwong@lucent.com
To: zefram@fysh.org (Zefram)
Cc: mkkwong@lucent.com, zsh-users@sunsite.auc.dk
Subject: Re: some directory changing tools to share
Date: Tue, 7 Mar 2000 09:33:09 -0600 (CST)	[thread overview]
Message-ID: <200003071533.JAA02588@w-kwong.ih.lucent.com> (raw)
In-Reply-To: <E12S7vP-0001Dv-00@crucigera.fysh.org> from "Zefram" at Mar 07, 2000 12:32:34 AM

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<tab>".  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 p<tab>t<tab>g<tab>".
> 
> >   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
> 


  parent reply	other threads:[~2000-03-07 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-06 21:14 mkkwong
2000-03-07  0:32 ` Zefram
2000-03-07  7:36   ` Andrej Borsenkow
2000-03-07 15:33   ` mkkwong [this message]
2000-03-07 11:06 ` Oliver Kiddle
2000-03-07 17:46   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200003071533.JAA02588@w-kwong.ih.lucent.com \
    --to=mkkwong@lucent.com \
    --cc=zefram@fysh.org \
    --cc=zsh-users@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).