-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
54 lines (43 loc) · 963 Bytes
/
install.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
#!/usr/bin/env bash
uname=`uname -s`
function link_dotfile {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
rm -rf $target
symlink_file $source $target
}
function symlink_file {
source=$1
target=$2
# For Windows
if [[ "$uname" = MINGW* || "$uname" = CYGWIN* ]]; then
sourcestep=${source:2}
source=${sourcestep//\//\\}
targetstep=${target:2}
target=${targetstep//\//\\}
$COMSPEC \/c link.bat\ ${HOMEDRIVE}$source\ ${HOMEDRIVE}$target
return
else
ln -sfv ${source} ${target}
fi
}
function link_bin {
if [ ! -d ${HOME}/bin ]; then
echo 'Making ~/bin directory'
mkdir -p ${HOME}/bin
fi
for binfile in bin/*
do
source="${PWD}/${binfile}"
target="${HOME}/${binfile}"
symlink_file $source $target
done
}
for i in _*
do
link_dotfile $i
done
link_bin
bundle_dir="$HOME/.vim/bundle"
mkdir -p $bundle_dir
git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim