Update vim plugin management scripts
This commit is contained in:
parent
6fe25c03f0
commit
b44a5c3b21
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue