Update vim plugin management scripts
This commit is contained in:
parent
6fe25c03f0
commit
b44a5c3b21
|
@ -1,17 +1,23 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Check vim plugins dir for unused plugins
|
# 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.
|
# Note: does not perform deletion at this time, pipe output to bash.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
pluginhome=$HOME/.vim/pack/git-plugins/opt
|
pluginhome=$HOME/.vim/pack/git-plugins
|
||||||
cd $pluginhome
|
|
||||||
|
|
||||||
|
cd $pluginhome/opt
|
||||||
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pluginpath
|
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' pluginpath
|
||||||
do
|
do
|
||||||
if ! grep -q "$pluginpath" $HOME/.vimrc ; then
|
if ! grep -q "$pluginpath" $HOME/.vimrc ; then
|
||||||
basename=$(basename $pluginpath)
|
basename=$(basename $pluginpath)
|
||||||
echo "rm -rf $pluginhome/$basename"
|
echo "rm -rf $pluginhome/opt/$basename"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$1" = "-a" ]; then
|
||||||
|
echo "rm -rf $pluginhome/start/*"
|
||||||
|
fi
|
||||||
|
|
|
@ -10,5 +10,7 @@ if [ -z "$1" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
basename=$(basename "$1" .git)
|
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"
|
git clone https://github.com/dense-analysis/ale.git "$basename"
|
||||||
|
|
Loading…
Reference in New Issue