Created
September 2, 2018 10:41
-
-
Save TeddyDD/56573563e51345e9558866bda5cd156d to your computer and use it in GitHub Desktop.
plugin manager for Kakoune
This file contains 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
define-command plug -params 1..2 %{ | |
%sh{ | |
plugdir="/$HOME/.config/kak/src" | |
[ -d $plugdir ] || mkdir -p "$plugdir" | |
repo=$(basename $1) | |
if [ ! -d "$plugdir/$repo" ]; then | |
git clone "https://github.com/$1" "$plugdir/$repo" | |
fi | |
if [ ! -z "$2" ]; then | |
# single file | |
echo "source $plugdir/$repo/$2.kak" | |
exit | |
fi | |
for f in $(echo $plugdir/$repo/*.kak); do | |
printf "source %s" "$f" | |
done | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment