Skip to content

Commit

Permalink
MOD: add deploy.sh for auto deploy vimrc config
Browse files Browse the repository at this point in the history
  • Loading branch information
cwgis committed Mar 19, 2013
1 parent cbc85e2 commit 3407c9e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -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

Expand Down
22 changes: 22 additions & 0 deletions 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

0 comments on commit 3407c9e

Please sign in to comment.