Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: preexec function to work after `&&'
- X-seq: zsh-users 6557
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Jesper Holmberg <jesper.holmberg.5791@xxxxxxxxxxxxx>
- Subject: Re: preexec function to work after `&&'
- Date: Wed, 10 Sep 2003 09:51:49 +0200
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <20030908191720.GR6280@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030813131429.GA2413@xxxxxxxxxxxx> <20030908191720.GR6280@xxxxxxxxxxxxxxxxxxxxxxxx>
Jesper Holmberg wrote:
> I only now found the time to experiment with Eric's neat preexec function,
> and it's very nice. However, I'd like it to also work with tab completion,
> is that possible?
Not without modifying completion functions I don't think.
Completion in command context uses the -command- special context. By
default this ($_comps[-command-]) is the _autocd function. So the
easiest is perhaps to write your own wrapper function:
_cmd_or_file() {
_alternative \
'files:file:_path_files -g "(#i)*.(html|jpg|jpeg|tif|tiff|png|doc|xls)"' \
'commands:command:_autocd'
}
Then use this new function for the -command- context:
compdef _cmd_or_file -command-
Or you might find it easier to just get the latest 4.1 sources from CVS
and try out Peter's new suffix aliases feature.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author