aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Linskey2026-05-29 23:19:39 -0400
committerBenjamin Linskey2026-05-29 23:19:39 -0400
commitf048645980233affeca5a78f9e381141ef8e4508 (patch)
tree27e7d0766aec11d15f29571b523e62056ceca707
parentae24c6c5c21b9ba522b1be4f01b09a259e08d635 (diff)
downloaddotfiles-f048645980233affeca5a78f9e381141ef8e4508.tar.gz

Allow branch specification for Vim plugins

-rwxr-xr-xinstall.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/install.sh b/install.sh
index 8e2d576..d418543 100755
--- a/install.sh
+++ b/install.sh
@@ -4,7 +4,10 @@ readonly VIM_REPOS="$HOME/.vim-plugins"
readonly VIM_PLUGS="$HOME/.vim/pack/plugins/start"
# Clones a Git repository into $VIM_REPOS if the repository does not already
-# exist there. Takes a single argument, the repository URL.
+# exist there.
+#
+# $1: Repository URL
+# $2 (optional): Branch
clone_plugin() {
path="${VIM_REPOS}/$(basename "$1")"
@@ -12,7 +15,12 @@ clone_plugin() {
return
fi
- git clone "$1" "$path"
+ if [ -n "$2" ]; then
+ git clone -b "$2" "$1" "$path"
+ else
+ git clone "$1" "$path"
+ fi
+
ln -s "$path" "$VIM_PLUGS"
}
@@ -37,7 +45,7 @@ if command -v vim >/dev/null; then
mkdir -p "$VIM_REPOS" "$VIM_PLUGS"
clone_plugin https://git.linskey.org/ale/
clone_plugin https://git.linskey.org/ctrlp.vim/
- clone_plugin https://git.linskey.org/iceberg.vim/
+ clone_plugin https://git.linskey.org/iceberg.vim/ btl/main
# Regenerate Vim help tags.
vim -e -s -u NONE -c 'helptags ALL' -c q;