dotfiles/script/cleanvimplugins

18 lines
421 B
Plaintext
Raw Normal View History

2021-04-03 08:51:47 +00:00
#!/usr/bin/env bash
2021-04-02 04:28:00 +00:00
#
# Check vim plugins dir for unused plugins
# Note: does not perform deletion at this time, pipe output to bash.
set -e
pluginhome=$HOME/.vim/pack/git-plugins/opt
cd $pluginhome
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"
fi
done