From 9e7af4fefe25d4b16b894e42406886f97705e9a9 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Thu, 18 Jan 2018 02:10:38 -0500 Subject: Created scripts to automate vim plugins management All scripts commit the changes. --- PlugInstall.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 PlugInstall.sh (limited to 'PlugInstall.sh') diff --git a/PlugInstall.sh b/PlugInstall.sh new file mode 100755 index 0000000..7d1c9d2 --- /dev/null +++ b/PlugInstall.sh @@ -0,0 +1,36 @@ +#!/bin/bash +if [ "$PWD" != "$HOME/dotfiles" ] +then + echo "Must be run in $HOME/dotfiles" + exit 1 +fi + + +PLUG_PATH="vim/.vim/pack/$USER/start/" +ARGS=0 +while getopts o opt; do + ((ARGS++)) + + if [ "$opt" == "o" ] + then + PLUG_PATH="vim/.vim/pack/$USER/opt/" + fi + if [ "$opt" == "h" ] + then + nroff .PlugHelp.tr + exit 0 + fi +done +((ARGS++)) +LINK="${!ARGS}" +PLUG_NAME=${LINK##*/} +FILENAME=${FILENAME%.git} +FILENAME="$PLUG_PATH$FILENAME" + +echo "Installing \"$PLUG_NAME\" into directory $PLUG_PATH" + + + +git submodule add $LINK $FILENAME && \ +git add .gitmodules $FILENAME && \ +git commit -m"Added vim plugin: $PLUG_NAME." && echo "Success" -- cgit v1.1