This repository was archived by the owner on Oct 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathinstall.sh
executable file
·98 lines (77 loc) · 2.57 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
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
REPO_URL="https://raw.githubusercontent.com/xlucas/go-vim-install/master"
DEPS_URL="$REPO_URL/deps"
RESR_URL="$REPO_URL/resources"
install_go() {
curl -s "$1" | sudo tar -C /usr/local -xzvf -
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
exit 0
}
install_vim() {
packages=$(curl -s "$DEPS_URL/ubuntu_packages")
plugins=$(curl -s "$DEPS_URL/vim_plugins")
# Backup
cp -f ~/.vimrc ~/.vimrc.old.$(date +%s)
# Install packages
sudo apt-get install -y ${packages[@]}
# Plugin manager bootstrap
mkdir -p ~/.vim/{autoload,bundle,colors,scripts}
wget -P ~/.vim/autoload "https://tpo.pe/pathogen.vim"
wget -P ~/.vim/colors "$RESR_URL/molokai.vim"
# Clone necessary stuff
for plugin in ${plugins[@]} ; do
echo "INSTALLING plugin $plugin"
git clone "https://${plugin}.git" ~/.vim/bundle/${plugin##*/}
done
# Closetag script and snippets
curl -sL -o ~/.vim/scripts/closetag.vim "http://vim.sourceforge.net/scripts/download_script.php?src_id=4318"
wget -P ~/.vim/bundle/vim-go/gosnippets/UltiSnips "$RESR_URL/go.snippets"
# YCM compilation
cd ~/.vim/bundle/YouCompleteMe && {
git submodule update --init --recursive
bash install.sh
} && cd -
# Powerline
pip install --user powerline-status
# Fonts
mkdir -p ~/.{fonts,config/fontconfig/conf.d}
wget -P ~/.fonts "http://jorrel.googlepages.com/Monaco_Linux.ttf"
wget -P ~/.fonts "https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf"
wget -P ~/.config/fontconfig/conf.d "https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf"
fc-cache -vf ~/.fonts
# Instant markdown
sudo npm -g install instant-markdown-d
# Vimrc
wget -P ~ "$RESR_URL/.vimrc"
# Path
echo "export PATH=\$PATH:$(readlink -f ~/.local/bin)" >> ~/.profile
exit 0
}
install_ws() {
packages=$(curl -s "$RAW_URL/go_packages")
# Prepare workspace path
mkdir -p $1
echo "export GOPATH=$1" >> ~/.profile
echo "export PATH=\$PATH:$1/bin" >> ~/.profile
. ~/.profile
# Download dependencies
cd ${GOPATH}
for package in ${packages[@]} ; do
go get ${package}
done
cd -
exit 0
}
# Main
case $1 in
"-go") install_go $2;;
"-vim") install_vim $2;;
"-work") install_ws $2;;
esac
echo "Usage : $0 OPTION"
echo " OPTION { "
echo " -go TARBALL_URL : go installation"
echo " -vim : vim installation"
echo " -work PATH : workspace setup"
echo " }"
exit 1