Skip to content

Update README.md - Zsh rebuilding the completion cache twice #1127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ Add `zinit light zsh-users/zsh-completions` to your `~/.zshrc`.

rm -f ~/.zcompdump; compinit

Second Solution:
zsh-completions as a plugin, they suggest manually adding its source directory to fpath before sourcing oh-my-zsh.sh.
This ensures Zsh loads the completion files only once, improving performance.
Recommended Fix:
Instead of the existing method, they propose adding this line:

fpath=($ZSH/custom/plugins/zsh-completions/src $fpath)

Comment on lines +64 to +71
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information is already there. The advice for Oh-my-Zsh! was updated years ago in response to #603.

What you're proposing is exactly the same as:

  • Add it to FPATH in your .zshrc by adding the following line before source "$ZSH/oh-my-zsh.sh":

      fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
    

...Which is exactly what the instructions already say.

### Contributing

Contributions are welcome, see [CONTRIBUTING](https://github.com/zsh-users/zsh-completions/blob/master/CONTRIBUTING.md).
Expand Down