Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Autocomplet with compdef _precommand
- X-seq: zsh-users 21820
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx, zsh-users@xxxxxxx
- Subject: Re: Autocomplet with compdef _precommand
- Date: Tue, 30 Aug 2016 10:56:36 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=n14r4Z5ZnC0sZEEm7bZ+Aj5fNGSo5P9atdJ17xR+FZE=; b=SmXUMFtaaorosKkR+XmiKA2KZEANxhOuNOLAOwZAoKEChsnQUS+DSuRr4NbrwLNiVt yi5BKlH1wXLZu3IQmZ/7Wo7JZCqrb/WIAZkaCEyfRZ7stReMlMw985Q3tqFVXBml2IHu 5iU9U2FuSZ7Iz7SZ/A3I/6LJkOxpN27iRWXGBLZeddMayas1P20sWLhuGWHMoLecCpXJ mg2vALnHUFbi6SkDHooEU5yrVe262qR0gs9wRNXHjXy5geCdi/LlYMATQveVd2XJVAns NcIkRyOaMv4I1dTB6OMq0QOSAKD8hVISBR4ucx26iSyu0vO9ykOCHWCpPr0JBMfq7siI +fGg==
- In-reply-to: <CADprNY=V7FJPkpFQGSLfTVN=qTE5R-pQaHQ3Y3qN3PpD2GLYew@mail.gmail.com>
- 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: <CADprNY=V7FJPkpFQGSLfTVN=qTE5R-pQaHQ3Y3qN3PpD2GLYew@mail.gmail.com>
On Aug 30, 7:35am, Michel wrote:
}
} How can I use a autocomplet like _precommand but without the autocd
} behaviour?
Unfortunately this is a little tricky.
The easiest thing might be this:
_start () {
setopt localoptions noautocd
_precommand "$@"
}
compdef _start start
More generically, the only zstyle that modifies autocd behavior is for
the "-command-" special context, so you have to use "zstyle -e" with
an evaluated test that determines whether "start" was the precommand
word AND whether the tags are being looked up for "cd":
zstyle -e :completion::complete:-command-:: tag-order \
'(( $precommands[(I)start] && $funcstack[(I)_cd] )) && reply=(-)'
Question for zsh-workers: Is it worth adding a style to _precommand
to selectively turn off autocd? If so, what should it be called?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author