1

As far as I can tell, my .zshrc doesn't manually source anything in /usr/share/zsh/vendor-completions. If I try to write, in my .zshrc, an alias for a command that has completions set up in /usr/share/zsh/vendor-completions, it doesn't work. However, if I edit the completions file in /usr/share/zsh/vendor-completions to add my aliasing at the end, then it does work.

For example, let's say I have a program foo, and a program bar that is an enhanced version of foo. And let's say I have tab completions in /usr/share/zsh/vendor-completions for foo but not for bar. So when I write alias foo=bar and compdef bar=foo in my .zshrc, the tab completions don't work. But if I write those two lines in /usr/share/zsh/vendor-completions, in the same file that sets up foo's tab completions, then it does work.

It seems like /usr/share/zsh/vendor-completions is loaded after .zshrc, but I couldn't find documentation on it. I'd like to know where vendor completions fit in during zsh's loading sequence, so I can confirm what is the right thing to do, as a package maintainer.

5
  • 1
    There is no mention of vendor-completions in the zsh source code. That must be an addition by your Unix vendor. Which is it? Commented Apr 15, 2022 at 18:36
  • @StéphaneChazelas I'm running Debian buster.
    – 2rs2ts
    Commented Apr 15, 2022 at 18:39
  • 1
    See /usr/share/doc/zsh-common/README.Debian Commented Apr 15, 2022 at 18:53
  • @StéphaneChazelas I see, that explains it. It is documented (briefly) in that readme. I could not find a repo link from the Debian package page for zsh, nor in the wiki, so I still don't know when /usr/share/zsh/vendor-completions gets loaded, but at least I know this isn't standard.
    – 2rs2ts
    Commented Apr 15, 2022 at 20:53
  • Actually, I was too quick to comment. I see that it explains that this path is included in fpath, which makes this easy to figure out. If you want to write this up as an answer then I am happy to accept it and give you some rep, otherwise I will answer my own question.
    – 2rs2ts
    Commented Apr 15, 2022 at 20:57

0

You must log in to answer this question.

Browse other questions tagged .