Skip to content

Migrating from zinit to zdharma continuum

vladislav doster edited this page May 12, 2022 · 2 revisions

Migrating from the zdharma repo to zdharma-continuum

When psprint deleted the original repository, zinit and some other zdharma applications were broken. That is because zinit is set to pull from the zdharma repo, which is now gone. Plugins hosted by the zdharma organization were broken in the same way.

To get rid of the git errors and to restore the ability to receive updates from this fork, follow these steps:

  1. Change all references to zdharma, Zsh-Packages, and zinit-zsh in your dotfiles (e.g.,.zshrc, .zprofile) to zdharma-continuum (example)

For the default added annexes, change them to

zinit light-mode for \
  zdharma-continuum/zinit-annex-{'readurl','bin-gem-node','patch-dl','rust'}

You can use the following command to make the changes for you automatically. Be sure to double check the results and fix any issues before continuing.

find . -name '.git*' -type d -prune -name '.idea*' -type d -prune -o -type f -print0 | 
  xargs -0 sed -i \
    -e 's@(zdharma|Zsh-Packages|zinit-zsh)/@zdharma-continuum/@' \
    -e 's@/z-a-readurl@/zinit-annex-readurl@' \
    -e 's@/z-a-bin-gem-node@/zinit-annex-bin-gem-node@' \
    -e 's@/z-a-bin-rust@/zinit-annex-rust@' \
    -e 's@/z-a-patch-dl@/zinit-annex-patch-dl@'
  1. In your Zinit git directory, update the git remote:
cd $ZINIT[BIN_DIR] \
&& git remote set-url origin https://github.com/zdharma-continuum/zinit.git \
&& git fetch origin \
&& git branch -m master main \
&& git branch -u origin/main main \
&& git remote set-head origin -a \
&& cd -
  1. Start a new Zsh session, delete all Zinit plugins, and reinstall them
zinit delete --all --yes && \
zinit update --urge

Alternatively, you can reinstall zinit entirely and follow the installation instructions. here.

Legacy issues

Find issues opened in zdharma/zinit here

Clone this wiki locally