zsh-users
 help / color / mirror / code / Atom feed
From: Manfred Lotz <ml_news@posteo.de>
To: zsh-users@zsh.org
Subject: Re: Where to put my own completions?
Date: Mon,  2 May 2022 18:06:32 +0000	[thread overview]
Message-ID: <12af3d6d-e6fb-c35b-cc23-d7950db705f1@posteo.de> (raw)
In-Reply-To: <a1e9ecbf-d099-47c7-86b6-29b9c5d0f6ef@www.fastmail.com>



On 5/2/22 15:07, Daniel Shahaf wrote:
> 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.
> 

Thanks for your reply.

I personally prefer to have a single file for each completion. I don't want to
fill the .zshrc with different completions where each completion could have
40-70 lines or so.


> Or one could use the XDG envvars / default paths:
> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
> 
> And for system-wise completions there's the site-functions dir, part of the default $fpath.
> 

From your reply I take that there is no recommendation from zsh perspective.


-- 
Manfred




  reply	other threads:[~2022-05-02 18:07 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
2022-05-02 18:06   ` Manfred Lotz [this message]
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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=12af3d6d-e6fb-c35b-cc23-d7950db705f1@posteo.de \
    --to=ml_news@posteo.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.vuxu.org/mirror/zsh/

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).