Skip to content

Instantly share code, notes, and snippets.

@TeddyDD
Created September 2, 2018 10:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TeddyDD/56573563e51345e9558866bda5cd156d to your computer and use it in GitHub Desktop.
Save TeddyDD/56573563e51345e9558866bda5cd156d to your computer and use it in GitHub Desktop.
plugin manager for Kakoune
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