zinit is not loading all the files for an OMZ plugin (OMZP::gitfast) #651
Replies: 1 comment 6 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
![image](https://private-user-images.githubusercontent.com/237869/324177359-78cb7aee-199f-4bc2-a451-72252a46314b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NDAzNjEsIm5iZiI6MTcxOTY0MDA2MSwicGF0aCI6Ii8yMzc4NjkvMzI0MTc3MzU5LTc4Y2I3YWVlLTE5OWYtNGJjMi1hNDUxLTcyMjUyYTQ2MzE0Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyOVQwNTQ3NDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yM2U1NGE2MDRjZmEwZGY1NTI1ZWZlOTZjYzJkNzVhYTI1NjY5MmM2ZjBkYjMzNzhhNGUxYjZkYjY5OTdhMTdjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9._fnjmBFS8DodCh1pjh20GjlNa5h1Ae-iI2Ud-AxX0hM)
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
![image](https://private-user-images.githubusercontent.com/237869/324177413-05a12745-b6e0-4c31-af8d-50477bb90e4a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NDAzNjEsIm5iZiI6MTcxOTY0MDA2MSwicGF0aCI6Ii8yMzc4NjkvMzI0MTc3NDEzLTA1YTEyNzQ1LWI2ZTAtNGMzMS1hZjhkLTUwNDc3YmI5MGU0YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyOVQwNTQ3NDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lYjk0ZTZiMmNjYTE5MmZiZDQ5MTQzMmU3Zjg3ZmEyNGExZTM5MzQ3MmYxMmNmODU5ZTQ1NTRkZWJiMWRkZGVmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.uVlS4b66gmFY6AnnGTqSHMGJukd7AojWysYocIJY88U)
what am I missing ?
Beta Was this translation helpful? Give feedback.
All reactions