Skip to content

autoload -U in default ~/.oh-my-zsh/oh-my-zsh.sh *runs* compinit #1002

Open
@maxzinkus

Description

It is my understanding that autoload -U should pull in function definitions for later use, hence the pattern (suggested in man zshcompsys):

autoload -U compinit
compinit

However, (as determined by much manual testing with ~/.zshrc:1:zmodload zsh/zprof and ~/.zshrc:-1:zprof, with no other calls, compinit is called once per shell startup. Commenting out oh-my-zsh.sh:68:autoload -U compaudit compinit zrecompile brings this down to 0 and makes shell startup dramatically faster.

The issue is that I further update the fpath after omz is loaded, which means that at every shell startup compinit is run twice: once by omz because of the reduced count of fpath functions since last complete startup, and then again after my customizations.

This is wildly annoying and should be resolved with ZSH_DISABLE_COMPFIX -- which prevents omz's explicit compinit call. However, the autoload line still runs compinit for whatever reason.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions