If I have an executable - say
~/bin/stuff in my
PATH, I can define this in my
.zshrc to have it autocomplete text files first as arguments to my command:
zstyle ':completion:*:*:stuff:*' file-patterns '*.txt:all-files' '*:all-files'
stuff is an alias - e.g
alias stuff=less, then this doesn't work anymore - and zsh just pretends like it should autocomplete to all-files as that's the default.
I've looked at the docs here - Zsh Completion System and not found anything more than talk of how to expand an alias - which is not what I'm looking for.
I think it's because the docs say argument pattern for
':completion:*:*:-command-:*:commands', but does that mean that the fourth section must be a command and not an alias. I always assumed they were more or less interchangeable in zsh.
I mean I can create a bunch one line executables that just have my alias followed by
"$@" in them - but that's just not elegant.