From b1d2b5af562b501388951bb330391808bec1a6d8 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Thu, 30 May 2019 02:17:00 -0400 Subject: [PATCH] add update_vim_plugins --- update_vim_plugins.sh | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 update_vim_plugins.sh diff --git a/update_vim_plugins.sh b/update_vim_plugins.sh new file mode 100755 index 0000000..6b6e90a --- /dev/null +++ b/update_vim_plugins.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +pull_plugins() { + local res + + for plugin in ./* + do + cd $plugin + + git pull -f + + res=$? + + if [[ $res -ne 0 ]] && [[ $res -ne 128 ]] + then + echo "error $res in $PWD" + exit 1 + fi + + if [[ $plugin = ./base16-vim ]] + then + echo "fixing attrs for $plugin" + sed -i '/Base16hi/! s/a:\(attr\|guisp\)/l:\1/g' colors/*.vim + fi + + if [[ -d doc ]] + then + echo "generating tags for $PWD" + vim --cmd "helptags doc/" --cmd "q" + fi + + cd .. + done +} +cd_and_pull() { + cd $1 + pull_plugins + cd .. +} + +cd ~/.vim/pack + +for folder in ./* +do + cd $folder + + [[ -d start ]] && cd_and_pull start + [[ -d opt ]] && [[ $1 = opt ]] && cd_and_pull opt + + cd .. +done