forked from turing1988/vimconf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimupdate.sh
executable file
·79 lines (64 loc) · 1.78 KB
/
vimupdate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
CURDIR=$PWD
CURVIMRC=$PWD/vimrc
VIMDIR=$HOME/.vim
VIMDIRBAK=$HOME/.vim.bak
VIMRC=$HOME/.vimrc
VIMRCBAK=$HOME/.vimrc.bak
echo $CURDIR
if ! [ -a $VIMDIR/bundle/vundle ]
then
if [ -e $VIMDIR ] || [ -e $VIMRC ]
then
echo "backup the $VIMDIR to $VIMDIRBAK,$VIMRC to $VIMRCBAK"
rm -rf $VIMDIRBAK $VIMRCBAK
mv -f $VIMDIR $VIMDIRBAK
mv -f $VIMRC $VIMRCBAK
fi
cp -rf $CURDIR $VIMDIR
cp -rf $CURVIMRC $VIMRC
cd $VIMDIR
echo -e 'Start to clone bundle '
mkdir $VIMDIR/bundle
git clone https://github.com/gmarik/vundle.git $VIMDIR/bundle/vundle
echo -e "Please wait for five minutes! Then the vim would have been installed !"
sleep 5
vim -c 'BundleUpdate'
git status
###procress patch
###In the future use the diff and patch instead of these.
###
###
PATCH1=$VIMDIR/bundle/doxygen-support.vim/plugin/doxygen-support.vim
if [ -e $PATCH1 ]
then
cp -rf patch/doxygen-support.vim $PATCH1
fi
PATCH2=$VIMDIR/bundle/QuickTemplate/plugin/Template.vim
if [ -e $PATCH2 ]
then
cp -rf patch/Template.vim $PATCH2
fi
PATCH3=$VIMDIR/bundle/bufexplorer.zip/plugin/bufexplorer.vim
if [ -e $PATCH3 ]
then
cp -rf patch/bufexplorer.vim $PATCH3
fi
PATCH4=$VIMDIR/bundle/Dictionary/plugin/dictionary.vim
if [ -e $PATCH4 ]
then
cp -rf patch/dictionary.vim $PATCH4
fi
echo -e "Deploy finished , You can run this script to update!"
cd $CURDIR
else
cd $VIMDIR
echo -e 'Start updating!'
git pull
echo -e "Please wait for five minutes! Then the vim would finish updating!\n"
vim -c 'BundleUpdate'
echo -e "Update finished\n"
git status
cd $CURDIR
fi
exit