Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How completions work, do they require fpath?
- X-seq: zsh-users 21198
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: How completions work, do they require fpath?
- Date: Thu, 28 Jan 2016 15:23:32 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=1NzL/tvm8mCZ2Z8k/WzaQ95PSFU+939HPIqe6mA//BU=; b=uKjnWhi9+zeXycYFZxYP6HEoBkM/+yq3LOdJDfvos2gXT9/cVqnys8ZsL4+OGtOMv5 F3aRxmtuXM6Wf2HaFq+Hjo6rIJnjWDlS74yLsFAB3VEjYteQMwRBTCTGawgARX82XF0i oK3In0xBo5QhorYHxl73LU7sJjKlTgTtaQy+RNFvi5g/U6e0EjD2c0tULe60e/g7hLr/ fBsoBQ/hS4qMTQJa/l0r9StHlDNkyefTjSE3O3DguhEn98zq/cmYstkqRShgbChbdp3Q 1JepXdEBEMDFboX88dNmOy3t1DsuqfvgV9qGAgWIcefa+WgrlulSX6Yap/YfVMX5YGdX pm/g==
- In-reply-to: <CAKc7PVCpFn=MeAMZM02vrFZZpiFw=hAhVnKTDpDYMuN1Y87WtQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCqw_Z+RnjzwEtoRVLSE1A9JSyVQYpg1E=6u5em5qDdkg@mail.gmail.com> <160126232017.ZM3789@torch.brasslantern.com> <CAKc7PVBcpYc4JjzWfuiqb=wjeQxtGF=vMDgxT7QTdLR2mPcJag@mail.gmail.com> <CAKc7PVCMPay34XS9up_CP-iZ79xPt2sZw35ngPBZZGN=_SRX_Q@mail.gmail.com> <160127231104.ZM17647@torch.brasslantern.com> <CAKc7PVCaf3qbwq_5RS-EwqHnhC+fSMPn+c4bJMuib9qYnyhcGA@mail.gmail.com> <CAKc7PVCpFn=MeAMZM02vrFZZpiFw=hAhVnKTDpDYMuN1Y87WtQ@mail.gmail.com>
On Jan 28, 8:39am, Sebastian Gniazdowski wrote:
}
} PS. Without compinit, compdef isn't available?
The compdef function is defined when compinit runs, yes.
The upshot is that you can either:
1. Put your function in a file whose name begins with "_", add a #compdef
line, put the file in a directory in $fpath, and finally run "compinit"
2. Name your function file any way that you like, run compinit whenever
it is convenient, put your file in a directory in $fpath or load it
some other way e.g. "source", but finally add your function to the
completion system by calling "compdef".
The intention is that #1 is simple and can be rubber-stamped for every
new completion function, but you always have #2 if #1 doesn't work for
some reason. Either way "compinit" has to happen to set up the rest of
compsys, so there's no point in defining "compdef" independently.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author