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

Re: Completion in pwd before subdirecories

On Dec 15,  9:07pm, Oliver Kiddle wrote:
} Bart wrote:
} > 
} > So why aren't we using "_files -g '*.gz(.)'" in that case?
} That's actually a much better plan.

I suppose really it should be "_files -g '*.gz(-.)'" ...

} We still need to ask whether the user should need a file-patterns style
} to achieve directories after files for the original menu completion
} question.

I presume this only applies in the case of also using the group-name and
group-order styles, because otherwise you don't get them separated in the
first place.

} Is globbed-files somewhere defaulting to `*'. Should it
} perhaps default to `*(.)'? I've not looked at _files but try ^Xh after
} something like `cat' or `:' with and without a file-patterns style.

It depends.

By default without a file-patterns style the only group is `*:all-files'.
So you have to have the file-patterns style to get any differentiation
at all.

tags in context :completion::complete:cat::
    all-files  (_files _default)

For commands that use "_files -g ..." the pattern passed in with -g is
used for globbed-files.

tags in context :completion::complete:gcc::
    argument-rest options  (_arguments _gcc)
tags in context :completion::complete:gcc:argument-rest:
    globbed-files  (_files _arguments _gcc) 
    directories    (_files _arguments _gcc) 
    all-files      (_files _arguments _gcc)

E.g. for "-g foo" it would be

    "foo:globbed-files *(-/):directories" "*:all-files"

Note that directories and globbed-files are completed together, which
normally means the extra directory would be suppressed as a duplicate.
It's only when wanting to split globbed-files and directories that you
see some directories twice, and that would be suppressed by using the
appropriate flags on the argument of -g.

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