From 75f0f6ade837915a6ffd6c4c2859aab6ce6d720c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 6 Jun 2026 18:09:43 +0200 Subject: *.sh -> scripts/ --- scripts/vim_plugins.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/vim_plugins.sh (limited to 'scripts/vim_plugins.sh') diff --git a/scripts/vim_plugins.sh b/scripts/vim_plugins.sh new file mode 100755 index 0000000..3801b74 --- /dev/null +++ b/scripts/vim_plugins.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +shopt -s inherit_errexit 2> /dev/null || true +shopt -s lastpipe + +plugins_dir="$HOME/.vim/pack/plugins/start" +readonly plugins_dir + +plugins=( + altercation/vim-colors-solarized + editorconfig/editorconfig-vim +) + +pull() { + local plugin + for plugin in ${plugins[@]+"${plugins[@]}"}; do + local name + name="${plugin#*/}" + + if [ -d "$name" ]; then + echo "Updating plugin: $plugin" + git -C "$name" pull + else + echo "Installing plugin: $plugin" + git clone -q "https://github.com/$plugin.git" + fi + done +} + +main() { + mkdir -p -- "$plugins_dir" + cd -- "$plugins_dir" + pull +} + +main -- cgit v1.3