feat: add deletevimplugin script
This commit is contained in:
parent
d26f2af5e5
commit
7e112c8bfb
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Delete a vim plugin.
|
||||
# Use with `-o` argument to delete from opt/
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = "-o" ]; then
|
||||
opt=1
|
||||
dir="$HOME/.vim/pack/git-plugins/opt"
|
||||
basename=$2
|
||||
else
|
||||
opt=0
|
||||
dir="$HOME/.vim/pack/git-plugins/start"
|
||||
basename=$1
|
||||
fi
|
||||
|
||||
if [ -z "$basename" ]; then
|
||||
echo "Usage: deletevimplugin [-o] <basename>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path="$dir/$basename"
|
||||
if [ ! -d "$path" ]; then
|
||||
echo "Plugin not found: $basename"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf $path
|
||||
|
||||
echo "Deleted $basename"
|
||||
|
||||
if [ $opt = 1 ]; then
|
||||
echo "Now, remove the following line to $HOME/.vimrc:"
|
||||
echo "packadd! $basename \" <git url>"
|
||||
fi
|
Loading…
Reference in New Issue