-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·49 lines (38 loc) · 1.69 KB
/
bootstrap.sh
File metadata and controls
executable file
·49 lines (38 loc) · 1.69 KB
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
#!/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)"
brew install trash-cli
fi
brew install direnv fd fzf git git-delta helix neovim ripgrep ruby starship tmux
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/wezterm.lua" "$HOME/.wezterm.lua"
mkdir -p "$HOME/.config/helix" && ln -sf "$dir/helix.toml" "$HOME/.config/helix/config.toml"
mkdir -p "$HOME/.config/ghostty" && ln -sf "$dir/ghostty" "$HOME/.config/ghostty/config"
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 git@github.com:gcapizzi/nvim-lua.git "$HOME/.config/nvim"