zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: zsh-users@math.gatech.edu (Zsh users list),
	"Stephen Riehm" <sr@pc-plus.de>
Subject: Re: zsh - new user with questions
Date: Tue, 18 Aug 1998 18:28:45 +0200	[thread overview]
Message-ID: <199808181628.SAA21807@hydra.ifh.de> (raw)
In-Reply-To: ""Stephen Riehm""'s message of "Tue, 18 Aug 1998 17:33:42 MST." <C1256664.00540607.00@bavaria3.pc-plus.de>

"Stephen Riehm" wrote:
>      extreme short cuts. ie: with tcsh's enhanced completions, to complete
> the file named: ReadMe.First
>      all I would type id: r.f<tab> - is there a way to do this sort of
> thing in zsh?

You can write your own function.  See Functions/multicomp in the
source distribution for examples.  If you really can't type uppercase
characters, you're going to have to redo the globbing there so
that every lowercase character becomes e.g. [rR], then you'll
need to handle .'s in the way /'s are handled there.  Ignoring case
may happen one day, but I doubt there's ever going to be a built-in
way of saying 'look and see if there are any characters preceeding a
dot to be added earlier on in the completion'.  Maybe you would be
interested in the options automenu and menucomplete.  You'll have
to find the shift key, however.  Do 'setopt automenu', type R,
and hit tab until it works.

>      - I tried use ls ***/*(/l2) to find all the empty directories in a
> tree, but it didn't work, instead it counted the number
>      of directories in each directory (I think, I wasn't quite sure what it
> was doing)

You need ls -d, and it doesn't just show empty directories since the link
count doesn't get incremented for plain files.  I don't think you
can do it in one glob expression.  Best I can think of (using your
glob to prune out non-terminal directories) is

for f in ***/*(/l2); do foo=($f/*(N)); [[ -z $foo ]] && print $f; done

*(N) turns on nullglob, i.e. $foo is empty if there was nothing in $f.

> Is it possible to make
>      all cd's happen in relation to your logical position?

This should happen with the option CHASE_LINKS unset.

> Is it possible to say that it should complete
> non-hidden directories, unless the text typed indicates
>      otherwise, ie: if I type "cd <tab>", I get a list of all the normal
> directories, but if I then type .<tab> it should use the
>      . and show me all the directories beginning with .

With 3.1.4, -/ is a better way of doing it than -g; this will work as you
want.  For more general things like that, you probably need to wait
until particular completions can be bound to particular keys, which
should happen some time.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy


  parent reply	other threads:[~1998-08-18 16:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-18 15:33 Stephen Riehm
1998-08-18 16:17 ` Matthew Lovell
1998-08-18 16:28 ` Peter Stephenson [this message]
1998-08-18 22:46   ` David Hedbor
1998-08-19  1:21     ` Bart Schaefer
1998-08-18 16:43 ` Zefram
1998-08-19 12:34 Stephen Riehm
1998-08-19 13:53 ` Goran Larsson
1998-08-19 16:03 ` Bart Schaefer
1998-08-19 15:09 Stephen Riehm
1998-08-19 17:35 ` Goran Larsson
1998-08-19 19:18   ` Bart Schaefer
1998-08-19 19:58     ` Roland Jesse
1998-08-20  9:47       ` Andrej Borsenkow
1998-08-20 11:27 Stephen Riehm

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=199808181628.SAA21807@hydra.ifh.de \
    --to=pws@ifh.de \
    --cc=sr@pc-plus.de \
    --cc=zsh-users@math.gatech.edu \
    /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).