add update_vim_plugins

master
an 2019-05-30 02:17:00 -04:00
parent 9456418edf
commit b1d2b5af56
1 changed files with 51 additions and 0 deletions

51
update_vim_plugins.sh Executable file
View File

@ -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