Skip to content
This repository
Browse code

MOD: add deploy.sh for auto deploy vimrc config

  • Loading branch information...
commit 3407c9ed1b99b5f959aeeb3f60e7b4dadfecedeb 1 parent cbc85e2
wengui cai authored March 20, 2013

Showing 2 changed files with 30 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  README.md
  2. 22  deploy.sh
16  README.md
Source Rendered
@@ -8,23 +8,23 @@ I put vim related settings in `bundle/config/plugin/config.vim` and isolate othe
8 8
 
9 9
 Installing
10 10
 ----------
11  
-BACKUP your `.vim` directory and `.vimrc` first.(IMPORTANT!)
12  
-
13 11
 Clone this repo:
14 12
 
15 13
 	git clone git://github.com/cwgis/vimrc.git ~/.vim
16  
-	cd ~/.vim && mv vimrc ~/.vimrc
17 14
 
18  
-Fetch submodules, in your `~/.vim` directory:
  15
+Fetch submodules, in your `repos` directory:
19 16
 
20  
-	git submodule init
21  
-	git submodule update
  17
+	sh deploy.sh
22 18
 
23  
-Upgrade submodules or plugins, in your `~/.vim` directory:
  19
+Update and Add plugins
  20
+----------------------
  21
+Upgrade submodules or plugins, in your `repos` directory:
24 22
 
  23
+	git submodule init
  24
+	git submodule update
25 25
 	git submodule foreach "git checkout master && git pull"
26 26
 
27  
-Add submodule or plugins, in your `~/.vim` directory:
  27
+Add submodule or plugins, in your `repos` directory:
28 28
 
29 29
 	git submodule add git://github.com:username/plugin.git bundle/plugin
30 30
 
22  deploy.sh
... ...
@@ -0,0 +1,22 @@
  1
+#!/bin/sh
  2
+CURRENT_DIR=`pwd`
  3
+[[ ! -e '~/.vimundodir']] || mkdir ~/.vimundodir
  4
+rm -rf ~/.vimundodir/*
  5
+
  6
+#backup the .vimrc and .vim
  7
+mv ~/.vim ~/.vimundodir/.vim
  8
+mv ~/.vimrc ~/.vimundodir
  9
+
  10
+#checkout plugins
  11
+git submodule init
  12
+git submodule update
  13
+
  14
+#copy the current vimrc to `~/` directory
  15
+cd ~/
  16
+cp -r "$CURRENT_DIR/vimrc" ~/.vimrc
  17
+
  18
+# make .vim directory under `~/` directory and copy current file to ~/.vim
  19
+cp -r "$CURRENT_DIR" ~/.vim/
  20
+
  21
+rm -rf "$CURRENT_DIR"
  22
+exit

0 notes on commit 3407c9e

Please sign in to comment.
Something went wrong with that request. Please try again.