Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: detect if compinit was run and rerun
- X-seq: zsh-users 23423
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: detect if compinit was run and rerun
- Date: Fri, 1 Jun 2018 19:46:08 +0200
- Cc: Paul Seyfert <pseyfert.mathphys@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=V0SG2AxKZmEdHETgdH1QESzzAM7hQRitvH53U4RXXMI=; b=usceY/xv6IlKGWzcvDU13leymwoCQ2dJ+SETZqE4SMJvJfD0IbvTKs6XC7VtAnExqr ztIsgLlSophs78kMeMqrjG/xzRsc1NAqkbmVyhv26z+XOULpIOVm4faXPinHiJ3BsYSp a/1jnLXFHN110J1Yx4J1XZDJIq8vD/fG4yoUDTT/3PXXZZSXH5bVcoeaU9NvqraQcH72 oneip5dl5Of6o7rvzuKljPVYxWPUFYeCJhMDdlZybV0N7lBOk2EIGqfwfo1D6QdGDI3g fZxI5QZiCxNH3Yet6tG0gcy+C8epuxJ3Z9uKmzJDBi90rTu9OkcVA5zKDH5/K+TA0GSy jbSA==
- In-reply-to: <CAHYJk3Tw7MisbkLWujDV-37HfAO9HOqKgzMVkp9z2NFdiBpKRw@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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20180601145818.GC17967@robusta> <CAHYJk3Tw7MisbkLWujDV-37HfAO9HOqKgzMVkp9z2NFdiBpKRw@mail.gmail.com>
On 1 June 2018 at 19:12, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> regenerations of the cache instead of 0. Instead, you should not do
> that. Just make sure your code that changes fpath is run before the
> user runs compinit (by asking the user to configure their shell
If this would be about startup of zsh, I would agree as second
compinit call with $fpath changed adds 820 ms. But for some dynamic
Zsh use with things plugged in and out, compinit should be a good
choice, it is specifically adapted to detect changes (it checks number
of _* files AFAIR?).
> correctly). If you absolutely want to add a completer at runtime, it
> is probably better to use only compdef+autoload and not compinit. I
> don't see any reason why the user would want to avoid having these
> completers always configured though.
Good point, compinit interiors are quite easy to grasp and manual
plugging is possible. For example, this code is generated by Zplugin's
installer:
autoload -Uz _zplugin
(( ${+_comps} )) && _comps[zplugin]=_zplugin
This plugs zplugin completion into already initialized completion
system. I'm doing this because until user organizes his .zshrc, some
time typically passes, and with above, during this time zplugin will
have a working completion. The ${+_comps} check detects if completion
is already initialized.
--
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author