Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Completion once again..



Tarmo Järvi wrote:

> Hello list,
> 
> and my apologies if this question has been asked several times but I couldn't find answer anywhere.
> 
> Anyway, here's my question: I have in ~/.zshrc:
> 
> compctl -g '*.(tar|t[ag]z|tz|tar.gz|tar.Z|tarZ|tar.bz2)' + -g '*(-/)' {,ls,un,g,gnu}tar
> 
> and in /tmp:
> 
> foo.tar
> bar/
> bar/snafu.tar
> 
> if I 'cd /tmp' and type tar <TAB> I get:
> 
> tar foo.tar
> 
> How do I get menu with all directories files matching definitions above? I've tried numerous tricks but I couldn't made it.

If you only want to see the matching files together with the
directories, use only one `-g' and apend the `*(-/)' to the `*.(tar|...)'
with a space betwen them.

If you want to see `foo.tar' and `bar/snafu.tar' as completions at the
same time, you would have to write a completion function and make it
be called `compctl -K'. There you could use `**/*.(tar|...)'. But I
doubt that you really want that, because of the possibility of
accidentally making it scan great parts of your directory structure.

Or maybe I didn't really understand what you want?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author