-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
41 lines (34 loc) · 1.2 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
#!/usr/bin/env bash
set -ex
WORKDIR="$PWD"
VIMRC=".vimrc"
CURRENT_USER_VIMRC="${HOME}/${VIMRC}"
# vim and other tools must be quite new, so use versions from brew
# install brew, LLVM, nodejs and vim
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
else
brew update
fi
brew install llvm vim nodejs
#generate bootstrap vim configuration
if [ ! -f "${CURRENT_USER_VIMRC}" ]; then
curl 'https://vim-bootstrap.com/generate.vim' \
--data 'langs=c&langs=python&langs=go&langs=&editor=vim' > "${CURRENT_USER_VIMRC}"
#install softlinks to local.rc files into home dir
find "$WORKDIR/vim" -type f -exec bash -c 'ln -sf $0 ~/$(basename $0)' {} \;
vim +VimBootstrapUpdate +PlugInstall +qall
ln -sf vim/.vim/coc-settings.json "${HOME}/.vim/coc-settings.json"
# install coc extensions
vim -c 'CocInstall -sync|q'
fi
#backup previous zshrc
ZSH_HOME="${HOME}/.oh-my-zsh"
if [ ! -f "${ZSH_HOME}" ]; then
git clone https://github.com/ohmyzsh/ohmyzsh.git "${ZSH_HOME}"
cp "${HOME}/.zshrc" "${HOME}/.zshrc.bak"
ln -sf shell/zshrc "${HOME}/.zshrc"
chsh -s $(which zsh)
fi