-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildvim.sh
executable file
·93 lines (76 loc) · 2.35 KB
/
buildvim.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
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env bash
GITHUB=~/Projects/github.com
VIM=~/.vim
AUTOLOAD=$VIM/autoload
BUNDLE=$VIM/bundle
COLORS=$VIM/colors
PLUGIN=$VIM/plugin
SNIPPETS=$VIM/snippets
mkdir -p $GITHUB
mkdir -p $VIM $AUTOLOAD $BUNDLE $COLORS $PLUGIN $SNIPPETS
function get_plugin() {
DIR=${1##*/}
echo "Getting $DIR..."
if [ -d $BUNDLE/$DIR ]; then
cd $BUNDLE/$DIR &&
git pull &&
cd - &>/dev/null
else
git clone $1 $BUNDLE/$DIR
fi
echo -e "Done.\n"
}
function get_pathogen() {
TMP=$GITHUB/tpope/vim-pathogen
echo "Getting vim-pathogen..."
if [ -d $TMP ]; then
cd $TMP &&
git pull &&
cd - &>/dev/null
else
mkdir -p $TMP &&
git clone https://github.com/tpope/vim-pathogen $TMP
fi
if [ ! -h $AUTOLOAD/pathogen.vim ]; then
echo "Creating symlink for pathogen.vim..."
ln -s $TMP/autoload/pathogen.vim $AUTOLOAD/
fi
echo -e "Done.\n"
}
# pathogen
get_pathogen
# get plugins
get_plugin https://github.com/scrooloose/nerdtree
get_plugin https://github.com/scrooloose/nerdcommenter
get_plugin https://github.com/tomtom/tlib_vim
get_plugin https://github.com/MarcWeber/vim-addon-mw-utils
get_plugin https://github.com/vim-airline/vim-airline
get_plugin https://github.com/vim-airline/vim-airline-themes
get_plugin https://github.com/tpope/vim-fugitive
get_plugin https://github.com/garbas/vim-snipmate
get_plugin https://github.com/honza/vim-snippets
get_plugin https://github.com/vimoutliner/vimoutliner
get_plugin https://github.com/sukima/xmledit
get_plugin https://github.com/ap/vim-css-color
# get solarized theme
if [ ! -f $COLORS/solarized.vim ]; then
echo "Getting solarized.vim color theme..."
wget -q -P $COLORS https://raw.githubusercontent.com/altercation/solarized/master/vim-colors-solarized/colors/solarized.vim
echo -e "Done.\n"
fi
# matchit.vim
if [ ! -f $PLUGIN/matchit.vim ]; then
echo "Creating symlink for matchit.vim..."
if [ "$(uname)" == "Darwin" ]; then
ln -snf /usr/share/vim/vim90/macros/matchit.vim $PLUGIN
elif [ "$(uname)" == "Linux" ]; then
ln -snf /usr/share/vim/vim80/macros/matchit.vim $PLUGIN
fi
echo -e "Done.\n"
fi
# my snippets
for s in $(ls vim/snippets/); do
echo "Creating symlink for $s..."
ln -snf $(pwd)/vim/snippets/$s $SNIPPETS/$s
echo -e "Done.\n"
done