From 3407c9ed1b99b5f959aeeb3f60e7b4dadfecedeb Mon Sep 17 00:00:00 2001 From: cwgis Date: Wed, 20 Mar 2013 01:07:32 +0800 Subject: [PATCH] MOD: add deploy.sh for auto deploy vimrc config --- README.md | 16 ++++++++-------- deploy.sh | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 deploy.sh diff --git a/README.md b/README.md index a336578..b36f6d7 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..0dfc973 --- /dev/null +++ b/deploy.sh @@ -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