diff options
| author | Benjamin Linskey | 2026-05-29 23:19:39 -0400 |
|---|---|---|
| committer | Benjamin Linskey | 2026-05-29 23:19:39 -0400 |
| commit | f048645980233affeca5a78f9e381141ef8e4508 (patch) | |
| tree | 27e7d0766aec11d15f29571b523e62056ceca707 | |
| parent | ae24c6c5c21b9ba522b1be4f01b09a259e08d635 (diff) | |
| download | dotfiles-f048645980233affeca5a78f9e381141ef8e4508.tar.gz | |
Allow branch specification for Vim plugins
| -rwxr-xr-x | install.sh | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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; |