diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-23 18:45:06 +0300 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-23 18:45:06 +0300 |
| commit | 2a5f36783292c3572a306553d28ffa138ad2ec38 (patch) | |
| tree | d2c74162ac4cd0b6d2a15e8909d67683dc3e0903 /scripts/vim.sh | |
| parent | .profile: enable ssh-agent via systemd (diff) | |
| download | linux-home-2a5f36783292c3572a306553d28ffa138ad2ec38.tar.gz linux-home-2a5f36783292c3572a306553d28ffa138ad2ec38.zip | |
scripts: vim_plugins.sh -> vim.sh
Diffstat (limited to 'scripts/vim.sh')
| -rwxr-xr-x | scripts/vim.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/vim.sh b/scripts/vim.sh new file mode 100755 index 0000000..3801b74 --- /dev/null +++ b/scripts/vim.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 |
