diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2018-02-01 02:49:17 -0500 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2018-02-01 02:53:58 -0500 |
commit | f186a6efd30dda2f2b0d454d419b26d34a802e5a (patch) | |
tree | 67b1470bfadcce5c6afbf51e69cad58e925c31d9 | |
parent | 198a40c17d6ae1bc880e181d10eff68232665cfe (diff) |
Added info about vimPlugins to README.
Added License to start of vimPlugins scripts, and moved scripts to
their own folder for use with stow.
-rwxr-xr-x | PlugInstall.sh | 36 | ||||
-rwxr-xr-x | PlugRemove.sh | 35 | ||||
-rwxr-xr-x | PlugUpdate.sh | 18 | ||||
-rw-r--r-- | README.rst | 62 | ||||
-rwxr-xr-x | vimPlugins/PlugInstall.sh | 62 | ||||
-rwxr-xr-x | vimPlugins/PlugRemove.sh | 60 | ||||
-rwxr-xr-x | vimPlugins/PlugUpdate.sh | 44 |
7 files changed, 227 insertions, 90 deletions
diff --git a/PlugInstall.sh b/PlugInstall.sh deleted file mode 100755 index 7d1c9d2..0000000 --- a/PlugInstall.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/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" diff --git a/PlugRemove.sh b/PlugRemove.sh deleted file mode 100755 index e8e0343..0000000 --- a/PlugRemove.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -#!/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++)) -NAME="${!ARGS}" -FILENAME="$PLUG_PATH$NAME" - -git submodule deinit -f $FILENAME -echo -git rm -f $FILENAME -echo -rm -rfv ".git/modules/$FILENAME" - -git commit -m"Removed vim plugin: $NAME" diff --git a/PlugUpdate.sh b/PlugUpdate.sh deleted file mode 100755 index 165219a..0000000 --- a/PlugUpdate.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -if [ "$PWD" != "$HOME/dotfiles" ] -then - echo "Must be run in $HOME/dotfiles" - exit 1 -fi - - -while getopts o opt; do - if [ "$opt" == "h" ] - then - nroff .PlugHelp.tr - exit 0 - fi -done - -git submodule update --remote --merge && \ -git commit -m"Updated vim plugins." && echo "Success" @@ -1,12 +1,30 @@ Tucker's Dotfiles ================= -These dotfiles are here mostly move them between my computers and +These dotfiles are here mostly to move them between my computers and as a backup, but feel free to use them yourself. +vimPlugins +---------- +These shell scrips are my solution to vim plugins, they use +git-submodules and vim 8's third party package loading. +I recomend reading `Vim: So long Pathogen, hello native package +loading <https://shapeshed.com/vim-packages/>`_, +as it was my reference when creating the scripts. +These will probably be move to their own repo someday, but I'm too +tired to do that now. + +.. warning :: + I just threw these scripts together one night, I do not trust them to be + completely stable, you should read through them and make sure you + understand what they are doing. + Installation ------------ +dotfiles +******** + .. note :: I recommend backing up any existing dotfiles you have before installing these, you can do this with the following command @@ -22,3 +40,45 @@ manage these files. This can be done with the following commands. 4. Run :code:`stow [program]` for each program's dotfiles you want to use *Example:* :code:`stow vim` or :code:`stow mutt` + +vimPlugins +********** + +I just run the vimPlugins scripts from my `dotfiles/vimPlugins` directory with +:code:`./PlugInstall`, you could link to them in `/usr/local/bin` by +running the following command as root (or with sudo). + +- :code:`stow -t /usr/local/bin vimPlugins` + + +Usage (vimPlugins) +------------------ + +.. note :: + These scripts must be run in `/home/$user/dotfiles`. You can change + this by editing the first few lines of the scripts. + +PlugInstall +*********** + +PlugInstall.sh takes in the link to a git repository the same as git +clone, the optional flag `-o` with place the plugin in the opt folder +(this means you will have to tell vim to start this plugin) + + *Example:* :code:`./PlugInstall.sh [-o] git@github.com/exampleAccount/exampl_repository` + +PlugUpdate +*********** + +PlugUpdate.sh takes in no arguments and will update the submodules. + + *Example:* :code:`./PlugUpdate.sh` + +PlugRemove +*********** + +PlugUpdate.sh takes in the name of the submodule (plugin) that you +would like to remove, the optional flag `-o` should be used if used in +the install. + + *Example:* :code:`./PlugRemove.sh [-o] example_repository` diff --git a/vimPlugins/PlugInstall.sh b/vimPlugins/PlugInstall.sh new file mode 100755 index 0000000..15caa0a --- /dev/null +++ b/vimPlugins/PlugInstall.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +#This script installs vim plugins using git submodules. +# +# +#MIT License +# +#Copyright (c) 2018 Tucker Evans +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +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" diff --git a/vimPlugins/PlugRemove.sh b/vimPlugins/PlugRemove.sh new file mode 100755 index 0000000..f2d9b6e --- /dev/null +++ b/vimPlugins/PlugRemove.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +#This script removes vim plugins installed with PlugInstall.sh. +# +# +#MIT License +# +#Copyright (c) 2018 Tucker Evans +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +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++)) +NAME="${!ARGS}" +FILENAME="$PLUG_PATH$NAME" + +git submodule deinit -f $FILENAME +echo +git rm -f $FILENAME +echo +rm -rfv ".git/modules/$FILENAME" + +git commit -m"Removed vim plugin: $NAME" diff --git a/vimPlugins/PlugUpdate.sh b/vimPlugins/PlugUpdate.sh new file mode 100755 index 0000000..ad48183 --- /dev/null +++ b/vimPlugins/PlugUpdate.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#This script updates vim plugins using git submodules. +# +# +#MIT License +# +#Copyright (c) 2018 Tucker Evans +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +if [ "$PWD" != "$HOME/dotfiles" ] +then + echo "Must be run in $HOME/dotfiles" + exit 1 +fi + + +while getopts o opt; do + if [ "$opt" == "h" ] + then + nroff .PlugHelp.tr + exit 0 + fi +done + +git submodule update --remote --merge && \ +git commit -m"Updated vim plugins." && echo "Success" |