Update vim plugin management scripts

This commit is contained in:
Rob Watson 2021-04-05 16:42:42 +02:00
parent 6fe25c03f0
commit b44a5c3b21
2 changed files with 12 additions and 4 deletions

View File

@ -1,17 +1,23 @@
#!/usr/bin/env bash
#
# Check vim plugins dir for unused plugins
# Pass -a to also clean all plugins from start/ folder.
#
# Note: does not perform deletion at this time, pipe output to bash.
set -e
pluginhome=$HOME/.vim/pack/git-plugins/opt
cd $pluginhome
pluginhome=$HOME/.vim/pack/git-plugins
cd $pluginhome/opt
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pluginpath
do
if ! grep -q "$pluginpath" $HOME/.vimrc ; then
basename=$(basename $pluginpath)
echo "rm -rf $pluginhome/$basename"
echo "rm -rf $pluginhome/opt/$basename"
fi
done
if [ "$1" = "-a" ]; then
echo "rm -rf $pluginhome/start/*"
fi

View File

@ -10,5 +10,7 @@ if [ -z "$1" ]; then
fi
basename=$(basename "$1" .git)
cd "$HOME/.vim/pack/git-plugins/start"
dirname="$HOME/.vim/pack/git-plugins/start"
mkdir -p "$dirname"
cd "$dirname"
git clone https://github.com/dense-analysis/ale.git "$basename"