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

Re: Completion of certain files suggested last



Jesper Holmberg wrote:
> I use menu-complete. I also have the following specified:
> 
> zstyle ':completion:*:*:(^rm):*:*' ignored-patterns '*?.o' '*?~' '(|*/)CVS' '*?.class'
> 
> so that object files, CVS directories etc are never tab completed. Now,
> I've realized that I sometimes still want to do something more than
> removing these kinds of files, and I've been bitten a couple of times by
> the fact that these files seem not to be there, as far as the completion
> system is concerned. So my question is this: is it possible to specify
> that these files be completed, but only after all other possibilities have
> been tried? I.e. if my directory contains the files:
> 
> aa.o bb.class cc.txt
> 
> pressing <tab> once gives me cc.txt, twice gives me aa.o etc?

There is an _ignored completer which completes ignored matches if no
others match. It's not entirely useful when the pattern is something
like *?.o though because a .c file tends to match. And it doesn't quite
do what you want. What you seem to be concerned with is the order in
which matches come up in menu-completion. I don't really use menu
completion myself so I've never thought about it. There is a file-sort
style but it probably isn't flexible enough. You might be able to use
file-patterns to put the .o etc files in a separate group which comes
later.

Oliver



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