Last active
February 6, 2025 10:39
-
-
Save neoascetic/7b1ac2568f81fd3068cf79396847c0d2 to your computer and use it in GitHub Desktop.
You don't need a zsh framework. You need just plug!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: plug! some/repo[:branch] [file-to.load ...] | |
# example: plug! sindresorhus/pure:main async.zsh pure.zsh | |
# to update everything - simply remove ~/.plug directory | |
function plug!() { | |
local arg=("${(@s/:/)1}") && r=$arg[1] && b=${arg[2]:=master} | |
local dir="$HOME/.plug/$r" | |
[[ -d $dir ]] || git clone --depth=1 --branch=$b https://github.com/$r $dir | |
for f in "${@:2}"; do source "$dir/$f"; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment