dotfiles/script/deletevimplugin

37 lines
613 B
Plaintext
Raw Permalink Normal View History

2023-09-18 05:58:09 +00:00
#!/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
2023-10-07 08:43:32 +00:00
rm -rf "$path"
2023-09-18 05:58:09 +00:00
echo "Deleted $basename"
if [ $opt = 1 ]; then
echo "Now, remove the following line to $HOME/.vimrc:"
echo "packadd! $basename \" <git url>"
fi