zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.dk
Subject: Re: [zsh 4.0.1 bug] filename completion
Date: Tue, 26 Jun 2001 13:18:59 +0200 (MET DST)	[thread overview]
Message-ID: <200106261118.NAA23966@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: <4a90a3eafbvincent@vinc17.org>

Vincent Lefevre wrote:

> On 26 Jun, Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> wrote:
> > It is. It makes no difference if one is named directory and other a file as
> > long as 'cd soft' works. And 'soft' *is* exact match for 'soft'.
> 
> OK, you're right. But then, "cd so" should complete to "cd soft" (and
> not "cd software"), then give the choice between "soft" (because it
> is a named directory) and "software" (directory in the cwd). [...]

That's what my patch does.

> BTW, can I define an alias "c." in such a way that it behaves as if
> cdpath were (.), or as "cd ./"?

Something like this:

  c.() {
    setopt localoptions nocdablevars # if you want that...
    local CDPATH
    cd $*
  }

(Or just use a function that sticks a `./' or `$PWD/' in front of the
first argument and then calls cd if that's enough for you.)

Completion for that:

  compdef c.=cd

This says that arguments for `c.' are to be completed as for `cd'.

  zstyle ':completion:*:*:c.:*' tag-order local-directories

And this says that you want only local directories (those in `.') to be
completed for `c.'.


Bye
  Sven


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


  reply	other threads:[~2001-06-26 11:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-25 23:01 Vincent Lefevre
2001-06-26  5:15 ` Bart Schaefer
2001-06-26  8:35   ` Andrej Borsenkow
2001-06-26  9:01     ` Sven Wischnowsky
2001-06-26 10:10     ` Vincent Lefevre
2001-06-26 10:28       ` Andrej Borsenkow
2001-06-26 11:06         ` Vincent Lefevre
2001-06-26 11:18           ` Sven Wischnowsky [this message]
2001-06-26 13:28             ` Vincent Lefevre
2001-06-26 13:29               ` Sven Wischnowsky
2001-06-26 13:37                 ` Vincent Lefevre
2001-06-26 13:49                   ` Sven Wischnowsky
2001-06-26  9:41   ` Vincent Lefevre

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=200106261118.NAA23966@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-users@sunsite.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).