zsh-users
 help / color / mirror / code / Atom feed
* Re: cd directory completion?
@ 1999-08-23 13:26 Sven Wischnowsky
  1999-08-23 14:03 ` Dominik Vogt
  0 siblings, 1 reply; 10+ messages in thread
From: Sven Wischnowsky @ 1999-08-23 13:26 UTC (permalink / raw)
  To: zsh-users; +Cc: Dominik Vogt


Dominik Vogt wrote:

> I'd like to have cd complete directory names as well as
> symlinks that point to directories (zsh-3.0.6). Is there
> a way to do this without writing a completion function?
> (And I don't want to fiddle with any 'chase symlink' setting
> there may be - I like them the way they are).  I couldn't
> find anything appropriate in the man page. If it's not
> possible without a function, has anybody written one and 
> can send it to me?

The simplest solution: compctl -/ cd

For more, see the `compctl-examples' file or the examples at
http://www.zsh.org.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: cd directory completion?
  1999-08-23 13:26 cd directory completion? Sven Wischnowsky
@ 1999-08-23 14:03 ` Dominik Vogt
  1999-08-23 14:09   ` Swen Thuemmler
  0 siblings, 1 reply; 10+ messages in thread
From: Dominik Vogt @ 1999-08-23 14:03 UTC (permalink / raw)
  To: wischnow, zsh-users

On Mon, Aug 23, 1999 at 03:26:11PM +0200, wischnow@informatik.hu-berlin.de wrote:
> 
> Dominik Vogt wrote:
> 
> > I'd like to have cd complete directory names as well as
> > symlinks that point to directories (zsh-3.0.6). Is there
> > a way to do this without writing a completion function?
> > (And I don't want to fiddle with any 'chase symlink' setting
> > there may be - I like them the way they are).  I couldn't
> > find anything appropriate in the man page. If it's not
> > possible without a function, has anybody written one and 
> > can send it to me?
> 
> The simplest solution: compctl -/ cd

Um, I think that's not the correct syntax, at least not for
3.0.6:

  # compctl -/ cd
  compctl: bad option: -/

I'll settle for

  compctl -n -g '*(-/) .*(-/) cd pushd

instead. Many thanks

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, dominik_vogt@hp.com


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

* Re: cd directory completion?
  1999-08-23 14:03 ` Dominik Vogt
@ 1999-08-23 14:09   ` Swen Thuemmler
  0 siblings, 0 replies; 10+ messages in thread
From: Swen Thuemmler @ 1999-08-23 14:09 UTC (permalink / raw)
  To: Dominik Vogt; +Cc: zsh-users

On Mon, 23 Aug 1999, Dominik Vogt wrote:

> Um, I think that's not the correct syntax, at least not for
> 3.0.6:
> 
>   # compctl -/ cd
>   compctl: bad option: -/
> 
> I'll settle for
> 
>   compctl -n -g '*(-/) .*(-/) cd pushd
> 
> instead. Many thanks

Hmm. I don't know if it does in 3.0.6, but in 3.1.5, this does not
complete .., so you always have to add the '/' if you want to cd
../something. I use the following:
compctl -g '*(-/)' + -g '..' + -g '.*(-/)' cd chdir dirs pushd

Greetings, Swen



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

* Re: cd directory completion?
  1999-08-23 14:07   ` Dominik Vogt
  1999-08-23 15:03     ` Sweth Chandramouli
@ 1999-08-25  4:32     ` Bek Oberin
  1 sibling, 0 replies; 10+ messages in thread
From: Bek Oberin @ 1999-08-25  4:32 UTC (permalink / raw)
  To: Dominik Vogt; +Cc: ozone, zsh-users

Dominik Vogt wrote:
> configs end up the same :-) But I wonder why you use whence
> and where at all (do you?). It's so much easier to just type
>   # ls =filename
> and hit TAB :-))

Wow, I never heard of that one!  Thanks :)


bekj
*mutter*newtricks*yay*mutter*

-- 
: --Hacker-Neophile-Eclectic-Geek-Grrl-Queer-Disabled-Boychick--
: gossamer@tertius.net.au   http://www.tertius.net.au/~gossamer/
: Good people can't out-think evil, cause evil thinks of things
: good folks can't think of.  -- Orson Scott Card, Homebody


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

* Re: cd directory completion?
  1999-08-23 14:07   ` Dominik Vogt
@ 1999-08-23 15:03     ` Sweth Chandramouli
  1999-08-25  4:32     ` Bek Oberin
  1 sibling, 0 replies; 10+ messages in thread
From: Sweth Chandramouli @ 1999-08-23 15:03 UTC (permalink / raw)
  To: zsh-users

On Mon, Aug 23, 1999 at 04:07:16PM +0200, Dominik Vogt wrote:
> 
> Looks pretty much like the stuff I use. In the end all compctl
> configs end up the same :-) But I wonder why you use whence
> and where at all (do you?). It's so much easier to just type
> 
>   # ls =filename
> 
> and hit TAB :-))

	yes, but that returns totally different information, especially in
zsh, where which and type are just cosmetic variants of whence--all three
thus go through the entire process of command lookup, including functions
and builtins.  the =<command> syntax just does alias expansion and 
executable searching via path, while (k/c)sh-style which just does executable
searching; these two also thus do not provide any information about whether 
some command is a function or a builtin, and don't expand aliases/functions/
builtins so that you can quickly see their definition without looking at
source files, etc.

	(i personally think the zsh versions of those commands should mirror 
the equivalent ksh tools in behaviour (it's sometimes very useful to only
do executable searching, for example), but since /bin/which and /bin/type
exist and act like the ksh versions, i've just aliased which and type to 
their executable versions.  (of course, then you have issues figuring out
just what `alias which=/bin/which ; alias which=$(whence -a which | head -1)' 
does, but that's what makes playing with your shell fun.))

	-- sweth.

-- 
Sweth Chandramouli ; <sweth@gwu.edu>
<a href="http://astaroth.nit.gwu.edu/resume/">Will Work For Food.</a>
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>


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

* Re: cd directory completion?
  1999-08-23 13:35 ` Andre Pang
@ 1999-08-23 14:07   ` Dominik Vogt
  1999-08-23 15:03     ` Sweth Chandramouli
  1999-08-25  4:32     ` Bek Oberin
  0 siblings, 2 replies; 10+ messages in thread
From: Dominik Vogt @ 1999-08-23 14:07 UTC (permalink / raw)
  To: ozone, zsh-users

On Mon, Aug 23, 1999 at 11:35:51PM +1000, ozone@ihug.com.au wrote:
> On Mon, Aug 23, 1999 at 03:22:19PM +0200, Dominik Vogt wrote:
> 
> > I'd like to have cd complete directory names as well as
> > symlinks that point to directories (zsh-3.0.6). Is there
> > a way to do this without writing a completion function?
> > (And I don't want to fiddle with any 'chase symlink' setting
> > there may be - I like them the way they are).  I couldn't
> > find anything appropriate in the man page. If it's not
> > possible without a function, has anybody written one and 
> > can send it to me?
> 
>     I dunno if this is any 'good' (from a technical zsh perspective), but
> here's mine for 3.1.5.  May (not) work on 3.0.6.  Also have provided other
                              ^^^^^

*does* work on 3.0.6.

> (really) simple ones which I've used.
> 
> compctl -g '*(-/) .*(-/)' cd    # what you want
> compctl -g '*(/) .*(/)' rmdir
> compctl -j -P % kill
> compctl -j -P % fg
> compctl -j -P % bg
> compctl -u w
> compctl -m whence
> compctl -c which
> compctl -c man
> compctl -u who

Looks pretty much like the stuff I use. In the end all compctl
configs end up the same :-) But I wonder why you use whence
and where at all (do you?). It's so much easier to just type

  # ls =filename

and hit TAB :-))

I'm especially fond of my man page completion.

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, dominik_vogt@hp.com


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

* Re: cd directory completion?
@ 1999-08-23 14:07 Sven Wischnowsky
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Wischnowsky @ 1999-08-23 14:07 UTC (permalink / raw)
  To: zsh-users; +Cc: Dominik Vogt


Dominik Vogt wrote:

> Um, I think that's not the correct syntax, at least not for
> 3.0.6:
> 
>   # compctl -/ cd
>   compctl: bad option: -/

Oops, I though that got added to 3.0.6, too. Sorry.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: cd directory completion?
  1999-08-23 13:22 Dominik Vogt
@ 1999-08-23 13:35 ` Andre Pang
  1999-08-23 14:07   ` Dominik Vogt
  0 siblings, 1 reply; 10+ messages in thread
From: Andre Pang @ 1999-08-23 13:35 UTC (permalink / raw)
  To: Dominik Vogt; +Cc: zsh-users

On Mon, Aug 23, 1999 at 03:22:19PM +0200, Dominik Vogt wrote:

> I'd like to have cd complete directory names as well as
> symlinks that point to directories (zsh-3.0.6). Is there
> a way to do this without writing a completion function?
> (And I don't want to fiddle with any 'chase symlink' setting
> there may be - I like them the way they are).  I couldn't
> find anything appropriate in the man page. If it's not
> possible without a function, has anybody written one and 
> can send it to me?

    I dunno if this is any 'good' (from a technical zsh perspective), but
here's mine for 3.1.5.  May (not) work on 3.0.6.  Also have provided other
(really) simple ones which I've used.

compctl -g '*(-/) .*(-/)' cd    # what you want
compctl -g '*(/) .*(/)' rmdir
compctl -j -P % kill
compctl -j -P % fg
compctl -j -P % bg
compctl -u w
compctl -m whence
compctl -c which
compctl -c man
compctl -u who

    Flame away if any of them suck :).


-- 
  __/\___/\_/\____/\____/\    Andre Pang
 /   /__  /   \_    \_  __)
(  :  /  (__:  )  |  |  _)_   ozone@ihug.com.au, andrep@cse.unsw.edu.au
 \___(  ______/|__;__|_____|  http://www.mindflux.com.au/ozone/
      \/ - #ozone             mobile ph#: 0411-882299


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

* Re: cd directory completion?
@ 1999-08-23 13:26 John Riddoch
  0 siblings, 0 replies; 10+ messages in thread
From: John Riddoch @ 1999-08-23 13:26 UTC (permalink / raw)
  To: dominik.vogt; +Cc: zsh-users

>I'd like to have cd complete directory names as well as
>symlinks that point to directories (zsh-3.0.6). Is there
>a way to do this without writing a completion function?
>(And I don't want to fiddle with any 'chase symlink' setting
>there may be - I like them the way they are).  I couldn't
>find anything appropriate in the man page. If it's not
>possible without a function, has anybody written one and 
>can send it to me?

I have:
compctl -g '*(-/)' + -g '.*(-/)' -v cd pushd rmdir
in my .zshrc file and it works fine for me, completing between dirs and 
symlinks to dirs and ignoring files.  I think I got it from www.dotfiles.com

>P.S.: please CC me on replies, I'm not on the list.

Well, you probably should be...

-- 
John Riddoch	Email: jr@scms.rgu.ac.uk	Telephone: (01224)262721
Room C6, School of Computer and Mathematical Science
Robert Gordon University, Aberdeen, AB25 1HG
I am Homer of Borg. Resistance is Fu... Ooooh! Donuts!


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

* cd directory completion?
@ 1999-08-23 13:22 Dominik Vogt
  1999-08-23 13:35 ` Andre Pang
  0 siblings, 1 reply; 10+ messages in thread
From: Dominik Vogt @ 1999-08-23 13:22 UTC (permalink / raw)
  To: zsh-users

I'd like to have cd complete directory names as well as
symlinks that point to directories (zsh-3.0.6). Is there
a way to do this without writing a completion function?
(And I don't want to fiddle with any 'chase symlink' setting
there may be - I like them the way they are).  I couldn't
find anything appropriate in the man page. If it's not
possible without a function, has anybody written one and 
can send it to me?

Bye

Dominik ^_^

P.S.: please CC me on replies, I'm not on the list.

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, dominik_vogt@hp.com


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

end of thread, other threads:[~1999-08-25  5:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-23 13:26 cd directory completion? Sven Wischnowsky
1999-08-23 14:03 ` Dominik Vogt
1999-08-23 14:09   ` Swen Thuemmler
  -- strict thread matches above, loose matches on Subject: below --
1999-08-23 14:07 Sven Wischnowsky
1999-08-23 13:26 John Riddoch
1999-08-23 13:22 Dominik Vogt
1999-08-23 13:35 ` Andre Pang
1999-08-23 14:07   ` Dominik Vogt
1999-08-23 15:03     ` Sweth Chandramouli
1999-08-25  4:32     ` Bek Oberin

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