Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command completion
- X-seq: zsh-users 16221
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: command completion
- Date: Sun, 14 Aug 2011 23:09:37 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=7msppM7SnCXS+tmsJOqxXxr5wl1+6DweOYPLEEYgDfs=; b=D1KFxMytyoOO4anoIXameNolP5oPC5HdqmlWO5gLtcmVZyCLNy/Nq5pqMu4er3bkQQ PnD5jh/0P9mMlDLpWrPvoCJDPRe+sF98zRXiEpIJ42dsJ91CNx+Eu4LJxGXvYg0PbrpG bzloeKuYYLu+T7ePqZI5204Ldy+Jhd+MELH34=
- In-reply-to: <20110814205936.GI20653@prunille.vinc17.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20110814205936.GI20653@prunille.vinc17.org>
On 14 August 2011 22:59, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> I asked a question several years ago about command/function/etc.
> completion, but never had an answer. I'd like command completion
> to be preferred over directory completion.
>
> For instance, if I create an executable file blah-cmd and a directory
> blah-dir in the current directory ("." being in the $PATH), and do:
>
> % rehash
> % zstyle ':completion:*:complete:-command-:*' tag-order 'commands'
> % bl[TAB]
>
> then I can see that various commands are proposed, but not blah-cmd.
>
> ^Xh (_complete_help) at this point outputs:
>
> tags in context :completion::complete:-command-::
> commands executables builtins functions aliases suffix-aliases reserved-words jobs parameters (_alternative _command_names _autocd (eval))
> commands (_path_commands _alternative _command_names _autocd (eval))
> jobs (_jobs _alternative _command_names _autocd (eval))
> parameters (_parameters _alternative _command_names _autocd (eval))
>
> Unfortunately not all the tags are described in the zshcompsys
> man page, and the description is quite short, so that I don't
> understand why blah-cmd hasn't been proposed.
>
> Then I've tried:
>
> % zstyle ':completion:*:complete:-command-:*' tag-order 'executables'
>
> but then both blah-cmd and blah-dir/ are proposed.
>
> Now, if I move blah-cmd somewhere else in $PATH, and use
>
> % zstyle ':completion:*:complete:-command-:*' tag-order 'commands'
> % blah[TAB]
>
> then only blah-cmd is proposed, as expected. However if I do:
>
> % mkdir ~/blah-hdir
> % cdpath=(. ~)
> % setopt AUTO_CD
> % blah[TAB]
>
> then both blah-cmd and blah-hdir/ are proposed. I don't see why
> blah-hdir/ should be regarded as a command.
Because it might contain executable files? What happens when you only
create the dir and don't do the other things?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author