Frank Terbeck wrote on Fri, 25 Sep 2020 00:02 +0200: > Georgy Komarov wrote: > > I encountered with a problem, when trying to use custom zsh completions. > > As debian/README.Debian states: > > Load-path for functions from other packages > ------------------------------------------- > > In respsonse to #620452, the zsh-binary from Debian's zsh package started to > provide two entries to $fpath (the search path for loadable functions) for > other packages to drop function files into: > > - /usr/share/zsh/vendor-completions for functions that add functionality to > zsh's function based completion system (compsys) > > - /usr/share/zsh/vendor-functions for all other functions > > If you maintain another Debian package that wants to add functions to zsh's > function load-path, please use the those conventions when installing function > files.
These directories are added to $fpath near the start. Therefore, files dropped into them will override files provided further down $fpath, which in particular includes completion functions shipped with zsh upstream. In particular, if [a file dropped into] vendor-completions and zsh upstream both provide completion for /usr/bin/foo, then the former will be used — even though it's not necessarily the better of the two. Recommend to review collisions on a case-by-case basis and resolve duplications (between zsh on the one hand, and zsh-completions or other upstreams on the other hand) as needed. Note that to look for collisions, it's not sufficient to look for filename collisions, since for a given external command (say, systemctl(8)) zsh upstream and a third-party upstream might use different filenames and function names (e.g., "_systemd" v. "_systemctl"). Cheers, Daniel