forked from xlucas/go-vim-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·143 lines (122 loc) · 3.79 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
install_go() {
curl -s "$1" | sudo tar -C /usr/local -xzvf -
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
exit 0
}
install_vim() {
dependencies=(
git
vim
build-essential
cmake
python-dev
python-pip
python-setuptools
ctags
xdg-utils
npm
silversearcher-ag
openjdk-8-jre
)
repositories=(
majutsushi/tagbar
fatih/vim-go
Valloric/YouCompleteMe
bling/vim-airline
tpope/vim-fugitive
scrooloose/nerdtree
jistr/vim-nerdtree-tabs
scrooloose/syntastic
ntpeters/vim-better-whitespace
sjl/gundo.vim
mattn/emmet-vim
Raimondi/delimitMate
szw/vim-maximizer
godlygeek/tabular
SirVer/ultisnips
suan/vim-instant-markdown
kien/ctrlp.vim
rking/ag.vim
rhysd/vim-grammarous
airblade/vim-gitgutter
dkprice/vim-easygrep
nelstrom/vim-qargs
junegunn/vim-easy-align
terryma/vim-multiple-cursors
)
# Backup
cp -f ~/.vimrc ~/.vimrc.old.$(date +%s)
# Install packages
sudo apt-get install -y ${dependencies[@]}
# Plugin manager bootstrap
mkdir -p ~/.vim/{autoload,bundle,colors,scripts}
wget -P ~/.vim/autoload "https://tpo.pe/pathogen.vim"
wget -P ~/.vim/colors "https://raw.githubusercontent.com/xlucas/go-vim-install/master/molokai.vim"
# Clone necessary stuff
for repository in ${repositories[@]} ; do
git clone "https://github.com/${repository}.git" ~/.vim/bundle/${repository#[^/]*/}
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 "https://raw.githubusercontent.com/xlucas/go-vim-install/master/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 -L -O - "https://raw.github.com/cstrap/monaco-font/master/install-font-ubuntu.sh" | bash
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 ~ "https://raw.githubusercontent.com/xlucas/go-vim-install/master/.vimrc"
# Path
echo "export PATH=\$PATH:$(readlink -f ~/.local/bin)" >> ~/.profile
exit 0
}
install_ws() {
dependencies=(
github.com/axw/gocov/gocov
github.com/jstemmer/gotags
github.com/nsf/gocode
github.com/rogpeppe/godef
golang.org/x/tools/cmd/goimports
golang.org/x/tools/cmd/oracle
golang.org/x/tools/cmd/gorename
github.com/golang/lint/golint
golang.org/x/tools/cmd/godoc
github.com/kisielk/errcheck
)
# Prepare workspace path
mkdir -p $1
echo "export GOPATH=$1" >> ~/.profile
echo "export PATH=\$PATH:$1/bin" >> ~/.profile
. ~/.profile
# Download dependencies
cd ${GOPATH}
for dependency in ${dependencies[@]} ; do
go get ${dependency}
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