aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Overbruck <overbruck@mir.de>2014-10-02 15:59:34 +0200
committerDuncan Overbruck <overbruck@mir.de>2014-10-02 15:59:34 +0200
commit33bfaace3816ff58729eb779641b9efb6904b813 (patch)
tree1651d00c66f97464ab4687def533e0ad1df26ceb
parent681eacb1e2e06402a751c13d5df7a44e27600851 (diff)
downloaddotfiles-33bfaace3816ff58729eb779641b9efb6904b813.tar.gz
better install
-rwxr-xr-x[-rw-r--r--]install-vim22
1 files changed, 17 insertions, 5 deletions
diff --git a/install-vim b/install-vim
index 5f299f6..418c7a7 100644..100755
--- a/install-vim
+++ b/install-vim
@@ -2,14 +2,26 @@
cd $(dirname $BASH_SOURCE)
BASE=$(pwd)
+VIM_PLUG=~/.vim/autoload/plug.vim
+VIM_RC=~/.vimrc
-export GIT_SSL_NO_VERIFY=true
-mkdir -p ~/.vim/autoload
-curl --insecure -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim
+echo $VIM_PLUG
-# vimrc
-mv -v ~/.vimrc ~/.vimrc.old 2> /dev/null
+# download plug
+if [ ! -f "$VIM_PLUG" ]; then
+ export GIT_SSL_NO_VERIFY=true
+ mkdir -p ~/.vim/autoload
+ curl --insecure -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim
+fi
+
+# move vimrc to vimrc.old
+if [ -f "$VIM_RC" ]; then
+ mv -v ~/.vimrc ~/.vimrc.old 2> /dev/null
+fi
+
+# link vimrc to repository
ln -sf $BASE/vimrc ~/.vimrc
+# install plugins
vim +PlugInstall +qall