-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·85 lines (73 loc) · 2.03 KB
/
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
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
#!/usr/bin/env bash
UNAME_STR=`uname`
VUNDLE_INSTALL_DIR=_vim/bundle/Vundle.vim
function link_file {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
if [ -e "${target}" ] && [ ! -L "${target}" ]; then
mv $target $target.bak
fi
ln -sf ${source} ${target}
}
function unlink_file {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
if [ -e "${target}.bak" ] && [ -L "${target}" ]; then
unlink ${target}
mv $target.bak $target
fi
}
if [ "$1" = "--unlink" ]; then
echo "Unlinking _* files..."
for i in _*
do
unlink_file $i
done
exit
elif [ "$1" = "--ycm" ]; then
# See: https://github.com/Valloric/YouCompleteMe/README.md
echo "Recompiling YouCompleteMe plugin..."
pushd ~/.vim/bundle/YouCompleteMe
git fetch
git reset --hard HEAD^
git submodule update --init --recursive
./install.sh --clang-completer
popd
exit
elif [ "$1" = "--wombat" ]; then
# Install the wombat theme
mkdir -p ~/.vim/colors
pushd ~/.vim/colors
wget -O wombat256mod.vim http://www.vim.org/scripts/download_script.php?src_id=13400
popd
exit
else
echo "Linking _* files..."
for i in _*
do
link_file $i
done
fi
# Check to make sure vi is not 'Small version without GUI'
vi_version=`vi --version | grep "Small version without GUI"`
if [[ ! -z $vi_version ]]; then
echo "ERROR! Wrong vi version. Current is small version without GUI"
echo "- probably need to install vim-gui-common, vim-runtime"
exit 9
fi
if [ ! -d "$VUNDLE_INSTALL_DIR" ]; then
echo "Installing Vundle..."
git clone https://github.com/gmarik/Vundle.vim.git $VUNDLE_INSTALL_DIR || echo "ERROR! Failed to install Vundle!" || exit 10
fi
echo "Install/Update Vundle bundles..."
if [[ "$UNAME_STR" == "Darwin" ]]; then
mvim -v +PluginInstall! +qall
else
vi +PluginInstall! +qall
fi
## TODO:
## install zsh
## install oh-my-zsh
## install pip
## pip install virtualenvwrapper
## apt-get install build-essential linux-headers-generic linux-headers-`uname -r`