-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·53 lines (41 loc) · 1.71 KB
/
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
#!/bin/bash
set -e
git_ensure() {
if [ -d "$2" ]; then
git -C "$2" pull
else
git clone "$1" "$2"
fi
}
if [[ "$CODESPACES" == "true" ]]; then
NONINTERNACTIVE=1 bash <(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
if command -v -- "brew" >/dev/null 2>&1; then
brew install direnv fd fzf git git-delta neovim ripgrep ruby starship tmux
fi
if command -v -- "port" >/dev/null 2>&1; then
sudo port install direnv fd fzf git git-delta neovim ripgrep starship tmux
fi
dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
echo "> set up symlinks"
ln -sf "$dir/zshrc" "$HOME/.zshrc"
ln -sf "$dir/gitconfig" "$HOME/.gitconfig"
ln -sf "$dir/gitignore" "$HOME/.gitignore"
ln -sf "$dir/tmux.conf" "$HOME/.tmux.conf"
ln -sf "$dir/alacritty.toml" "$HOME/.alacritty.toml"
ln -sf "$dir/wezterm.lua" "$HOME/.wezterm.lua"
if [[ "$CODESPACES" == "true" ]]; then
printf '%s\n%s\n' "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" "$(cat ~/.zshrc)" >~/.zshrc
sudo chsh "$(id -un)" --shell "/usr/bin/zsh"
fi
echo "> zsh plugins and completions"
mkdir -p "$HOME/.zsh"
git_ensure https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
git_ensure https://github.com/zsh-users/zsh-history-substring-search ~/.zsh/zsh-history-substring-search
git_ensure https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting
git_ensure https://github.com/zsh-users/zsh-completions.git ~/.zsh/zsh-completions
echo "> tmux plugins"
git_ensure https://github.com/catppuccin/tmux.git ~/.config/tmux/plugins/catppuccin
echo "> install nvim config"
git_ensure https://github.com/gcapizzi/nvim-lua.git "$HOME/.config/nvim"