Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Question to maintainers of third-party packages that install zsh completions
- X-seq: zsh-workers 48376
- From: Frank Terbeck <ft@xxxxxxx>
- To: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Question to maintainers of third-party packages that install zsh completions
- Date: Fri, 02 Apr 2021 13:56:41 +0200
- Archived-at: <https://zsh.org/workers/48376>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-04/87zgyg3nnq.fsf%40ft.bewatermyfriend.org>
- In-reply-to: <65b1ebd7-d090-4642-b755-ad4a0eec34cf@www.fastmail.com> (Daniel Shahaf's message of "Thu, 01 Apr 2021 23:11:28 +0000")
- List-id: <zsh-workers.zsh.org>
- References: <65b1ebd7-d090-4642-b755-ad4a0eec34cf@www.fastmail.com>
Hi,
Daniel Shahaf wrote:
> Where would you expect the answer to "How does one install third-party
> zsh completions in such a way that zsh will pick them up automatically?"
> to be found? I'd like to make sure the documentation has this
> information where people who look for it will find it.
Tough question to answer in full generality. Depends on the kind of in-
stallation you're interested in, too. Debian's vendor package, for exam-
ple, has the following convention¹:
[..snip..]
Load-path for functions from other packages
-------------------------------------------
In respsonse to #620452, the zsh-binary from Debian's zsh package star-
ted to provide two entries to $fpath (the search path for loadable func-
tions) for other packages to drop function files into:
- /usr/share/zsh/vendor-completions for functions that add functiona-
lity 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 instal-
ling function files.
[..snap..]
This was done to keep ‘/usr/local/share/zsh/site-functions’ available
for purely local additions to the load-path. Debian does not put the
‘site-functions’ directory into ‘/usr’ (sans /local), because the non-
local part of ‘/usr’ is meant to be managed by Debian's package system.
Not all vendors do this, of course. But it neatly keeps package and site
local installation separate.
Still, however, the ‘site-functions’ directory is always the first entry
in the load-path list, based on all compile-time options. So, for purely
local function installation, this may be good enough:
zsh -f -c 'print ${fpath[1]}'
Vendors may have additional requirements when it comes to their package
system.
Regards, Frank
¹ https://salsa.debian.org/debian/zsh/-/blob/debian/debian/README.Debian
Messages sorted by:
Reverse Date,
Date,
Thread,
Author