help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: Where to put my own completions?
Date: Mon, 02 May 2022 13:07:37 +0000	[thread overview]
Message-ID: <a1e9ecbf-d099-47c7-86b6-29b9c5d0f6ef@www.fastmail.com> (raw)
In-Reply-To: <0fe4c854-85a5-3b4a-0a81-cfca1e00f7ae@posteo.de>

Manfred Lotz wrote on Mon, 02 May 2022 11:31 +00:00:
> I have some completions outsided of packages. Once I decided to put those
> completions into ~/.zfunc directory and define things like follows
> fpath+=~/.zfunc
> autoload -Uz compinit
> zstyle ':completion:*' menu select
> compinit
> Question: Is there a recommended directory where to put completions into, or is
> it just like "Do what you want!" ?

I tend to put them in my zshrc alongside the function definitions:

f() { echo $1 $2 }
_f() { _arguments "1:foo" "2:bar" }
compdef _f f

It's convenient since they tend to change in lockstep.

Or one could use the XDG envvars / default paths:

And for system-wise completions there's the site-functions dir, part of the default $fpath.



  reply	other threads:[~2022-05-02 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 11:31 Manfred Lotz
2022-05-02 13:07 ` Daniel Shahaf [this message]
2022-05-02 18:06   ` Manfred Lotz
2022-05-04  9:10 ` zzapper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1e9ecbf-d099-47c7-86b6-29b9c5d0f6ef@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).