zinit is not loading all the files for an OMZ plugin (OMZP::gitfast) #651
Replies: 1 comment 8 replies
-
See #504 for more info, but basically Github has discontinued support for git-svn which was used to clone contents of a specific folder. Yesterday I made the following workaround for this issue (only works for OMZ plugins, prezto support should be easy to add though). Place the following snippet before the zinit calls in .zshrc: setopt RE_MATCH_PCRE # _fix-omz-plugin function uses this regex style
# Workaround for zinit issue#504: remove subversion dependency. Function clones all files in plugin
# directory (on github) that might be useful to zinit snippet directory. Should only be invoked
# via zinit atclone"_fix-omz-plugin"
_fix-omz-plugin() {
if [[ ! -f ._zinit/teleid ]] then return 0; fi
if [[ ! $(cat ._zinit/teleid) =~ "^OMZP::.*" ]] then return 0; fi
local OMZP_NAME=$(cat ._zinit/teleid | sed -n 's/OMZP:://p')
git clone --quiet --no-checkout --depth=1 --filter=tree:0 https://github.com/ohmyzsh/ohmyzsh
cd ohmyzsh
git sparse-checkout set --no-cone plugins/$OMZP_NAME
git checkout --quiet
cd ..
local OMZP_PATH="ohmyzsh/plugins/$OMZP_NAME"
local file
for file in $(ls -a ohmyzsh/plugins/$OMZP_NAME); do
if [[ $file == '.' ]] then continue; fi
if [[ $file == '..' ]] then continue; fi
if [[ $file == '.gitignore' ]] then continue; fi
if [[ $file == 'README.md' ]] then continue; fi
if [[ $file == "$OMZP_NAME.plugin.zsh" ]] then continue; fi
cp $OMZP_PATH/$file $file
done
rm -rf ohmyzsh
} Each zinit call with OMZP should then be prefaced with zinit wait lucid for \
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
zdharma-continuum/fast-syntax-highlighting \
atclone"_fix-omz-plugin" \
OMZP::colored-man-pages \
atclone"_fix-omz-plugin" \
OMZP::vscode \
atclone"_fix-omz-plugin" \
OMZP::aliases \
blockf \
zsh-users/zsh-completions \
atload"!_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions To make this work when the plugin has already been enabled before applying this fix (and thus downloaded into ~/.local/share/zinit/snippets/) the snippet folder needs to be deleted so that it's cloned again. |
Beta Was this translation helpful? Give feedback.
-
Hello,
thanks a lot for this tool
I'm trying to install this Omz plugin
But it ends with this error
/home/wsl/.local/share/zinit/snippets/OMZP::gitfast/OMZP::gitfast:source:6: no such file or directory: /home/wsl/.local/share/zinit/snippets/OMZP::gitfast/git-prompt.sh
When I check the content of the folder /home/wsl/.local/share/zinit/snippets/OMZP::gitfast
content of
/home/wsl/.local/share/zinit/snippets/OMZP::gitfast/OMZP::gitfast
isnot all the files have been downloaded from https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitfast by zinit
what am I missing ?
Beta Was this translation helpful? Give feedback.
All reactions