-
Notifications
You must be signed in to change notification settings - Fork 1
/
macos-bootstrap.sh
70 lines (53 loc) · 2.58 KB
/
macos-bootstrap.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
#!/bin/bash
set -eu
if [[ ! -e /usr/local/bin/z.sh ]]; then
echo "==> Installing z"
git clone https://github.com/rupa/z.git
sudo cp ./z/z.sh /usr/local/bin && rm -rf ./z
fi
VIM_PLUG_FILE="${HOME}/.vim/autoload/plug.vim"
if [ ! -f "${VIM_PLUG_FILE}" ]; then
echo "==> Installing vim plug"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo " ==> Vim plugins will be installed on vim startup"
fi
NEOVIM_PLUG_FILE="${HOME}/.local/share/nvim/site/autoload/plug.vim"
if [ ! -f "${NEOVIM_PLUG_FILE}" ]; then
echo "==> Installing neovim plug"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
echo "==> Neovim plugins will be installed on nvim startup"
fi
if [ ! -d "${HOME}/.oh-my-zsh" ]; then
echo "==> Installing oh-my-zsh + zsh plugins"
git clone https://github.com/ohmyzsh/ohmyzsh.git ${HOME}/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
git clone https://github.com/zsh-users/zsh-autosuggestions "${HOME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
fi
if ! echo $SHELL | grep "zsh" > /dev/null; then
echo "==> Setting shell to zsh..."
chsh -s /usr/bin/zsh
fi
echo "==> Creating dev directories"
mkdir -p ~/Development
echo "==> Setting up dotfiles"
git remote set-url origin [email protected]:lucaslago/dotfiles.git
ln -sf $(pwd)/vimrc "${HOME}/.vimrc"
mkdir -p "${HOME}/.config/nvim" && ln -sf $(pwd)/init.vim "${HOME}/.config/nvim/init.vim" && ln -sf $(pwd)/coc-settings.json "${HOME}/.config/nvim/coc-settings.json"
ln -sf $(pwd)/zshrc "${HOME}/.zshrc"
ln -sf $(pwd)/tmux.conf "${HOME}/.tmux.conf"
ln -sf $(pwd)/tmate.conf "${HOME}/.tmate.conf"
ln -sf $(pwd)/gitconfig "${HOME}/.gitconfig"
mkdir -p "${HOME}/.config/coc/extensions" && ln -sf $(pwd)/coc-nvim/package.json "$HOME/.config/coc/extensions/package.json" && (cd "$HOME/.config/coc/extensions" && npm install --global-style --ignore-scripts --no-bin-links --no-package-lock --only=prod)
if [ ! -d "${HOME}/.tmux/plugins" ]; then
echo " ==> Installing tmux plugins"
git clone https://github.com/tmux-plugins/tpm "${HOME}/.tmux/plugins/tpm"
${HOME}/.tmux/plugins/tpm/bin/install_plugins
fi
if ! command -v graphql-lsp > /dev/null; then
echo "==> Installing graphql-lsp"
npm install --global graphql-language-service-cli
fi
echo "Change terminal color to gruvbox-dark by running 'bash ./gruvbox-dark.sh'"
echo "Done!"