zsh-users
 help / color / mirror / code / Atom feed
* autoexpand dirs to depth n
@ 2012-07-15 18:49 Eric Smith
  2012-07-16 19:28 ` Peter Stephenson
  2012-07-16 20:51 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Smith @ 2012-07-15 18:49 UTC (permalink / raw)
  To: Zsh Users

Hi zshellers

How do I configure completion to display all directory expansions to a depth
of n?

Then when I identify the branch I want to expand, I want to use 
globbing so that

when in 
/var/www $ *oo*az<tab>
will match something like
/foo/bar/baz

Eric


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: autoexpand dirs to depth n
  2012-07-15 18:49 autoexpand dirs to depth n Eric Smith
@ 2012-07-16 19:28 ` Peter Stephenson
  2012-07-16 20:51 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2012-07-16 19:28 UTC (permalink / raw)
  To: Zsh Users

On Sun, 15 Jul 2012 20:49:44 +0200
Eric Smith <es@fruitcom.com> wrote:
> How do I configure completion to display all directory expansions to a depth
> of n?
> 
> Then when I identify the branch I want to expand, I want to use 
> globbing so that
> 
> when in 
> /var/www $ *oo*az<tab>
> will match something like
> /foo/bar/baz

I'm not aware of any shortcuts to having to type at least the right
number of slashes.  Once you've done that, the completion system is able
to complete the strings after the slashes at each level, but only if you
have a string to match at the start.  Getting it to guess how many slashes to
insert is tricky; the logic is already complicated when it knows where
they go.  So the best you can do here is //*oo/*az with globcomplete
enabled (and I don't know how well that works in practice; in particular
whether it completes between // is style dependent).

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: autoexpand dirs to depth n
  2012-07-15 18:49 autoexpand dirs to depth n Eric Smith
  2012-07-16 19:28 ` Peter Stephenson
@ 2012-07-16 20:51 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2012-07-16 20:51 UTC (permalink / raw)
  To: Zsh Users

On Jul 15,  8:49pm, Eric Smith wrote:
}
} How do I configure completion to display all directory expansions to a
} depth of n?

In what context?  Command position (e.g., first word on the line)?  Or
following what other input?

If the former, you'll very likely need a custom widget with its own key
binding, rather than overloading TAB.  If there's other context there
may be a way to write a custom completer to do it.

} Then when I identify the branch I want to expand

What does "identify the branch" imply?  Mechanically (e.g., in terms of
keystrokes), how do you want to "identify" it?  After you "identify" it,
does it get inserted on the command line so it becomes a prefix for the
next step?

} I want to use globbing so that

Globbing won't match directory separators in the filesystem (see PWS's
reply).  However, if you've already generated a listing of all the
possible files and directories somehow (e.g. "find ... -maxdepth n"),
you could then apply a pattern completer (such as _multi_parts) to
pick out the appropriate subset.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-16 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-15 18:49 autoexpand dirs to depth n Eric Smith
2012-07-16 19:28 ` Peter Stephenson
2012-07-16 20:51 ` Bart Schaefer

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).