Permalink
Browse files

MOD: add deploy.sh for auto deploy vimrc config

  • Loading branch information...
1 parent cbc85e2 commit 3407c9ed1b99b5f959aeeb3f60e7b4dadfecedeb cwgis committed Mar 19, 2013
Showing with 30 additions and 8 deletions.
  1. +8 −8 README.md
  2. +22 −0 deploy.sh
View
@@ -8,23 +8,23 @@ I put vim related settings in `bundle/config/plugin/config.vim` and isolate othe
Installing
----------
-BACKUP your `.vim` directory and `.vimrc` first.(IMPORTANT!)
-
Clone this repo:
git clone git://github.com/cwgis/vimrc.git ~/.vim
- cd ~/.vim && mv vimrc ~/.vimrc
-Fetch submodules, in your `~/.vim` directory:
+Fetch submodules, in your `repos` directory:
- git submodule init
- git submodule update
+ sh deploy.sh
-Upgrade submodules or plugins, in your `~/.vim` directory:
+Update and Add plugins
+----------------------
+Upgrade submodules or plugins, in your `repos` directory:
+ git submodule init
+ git submodule update
git submodule foreach "git checkout master && git pull"
-Add submodule or plugins, in your `~/.vim` directory:
+Add submodule or plugins, in your `repos` directory:
git submodule add git://github.com:username/plugin.git bundle/plugin
View
@@ -0,0 +1,22 @@
+#!/bin/sh
+CURRENT_DIR=`pwd`
+[[ ! -e '~/.vimundodir']] || mkdir ~/.vimundodir
+rm -rf ~/.vimundodir/*
+
+#backup the .vimrc and .vim
+mv ~/.vim ~/.vimundodir/.vim
+mv ~/.vimrc ~/.vimundodir
+
+#checkout plugins
+git submodule init
+git submodule update
+
+#copy the current vimrc to `~/` directory
+cd ~/
+cp -r "$CURRENT_DIR/vimrc" ~/.vimrc
+
+# make .vim directory under `~/` directory and copy current file to ~/.vim
+cp -r "$CURRENT_DIR" ~/.vim/
+
+rm -rf "$CURRENT_DIR"
+exit

0 comments on commit 3407c9e

Please sign in to comment.