Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding a completion file has created a delay in ZSH startup time
- X-seq: zsh-users 27168
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Peter Slížik <peter.slizik@xxxxxxxxx>
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: Adding a completion file has created a delay in ZSH startup time
- Date: Wed, 29 Sep 2021 11:54:04 +0200
- Archived-at: <https://zsh.org/users/27168>
- In-reply-to: <CAC-uhUD1ov=_ukH0S+3g7HQz6EMEG1sh7HU_2B+zzjVgiwQuwQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAC-uhUD1ov=_ukH0S+3g7HQz6EMEG1sh7HU_2B+zzjVgiwQuwQ@mail.gmail.com>
On Wed, Sep 29, 2021 at 11:45 AM Peter Slížik <peter.slizik@xxxxxxxxx> wrote:
>
> Hello,
>
> I've added ~/.zsh/completions to fpath:
>
> fpath=(~/.zsh/autoload ~/.zsh/completions $fpath)
>
> this seemingly simple change has added 1 or 2 seconds to ZSH start time.
This usually happens when compinit is invoked before and after you
modify fpath. The biggest offender here is Ubuntu. Its global zshrc
has this awfulness:
# If you don't want compinit called here, place the line
# skip_global_compinit=1
# in your $ZDOTDIR/.zshenv
if grep -q '^ID.*=.*ubuntu' /etc/os-release && [[ -z
"$skip_global_compinit" ]]; then
autoload -U compinit
compinit
fi
The solution is to add skip_global_compinit=1 to ~/.zshenv.
Naturally, you also need to ensure that your own rc files invoke
compinit only once, after all changes to fpath.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author