-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·114 lines (92 loc) · 3.62 KB
/
setup.sh
File metadata and controls
executable file
·114 lines (92 loc) · 3.62 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
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
#!/bin/zsh
set -euo pipefail
# mac os stuff
echo "Set up brew os settings"
defaults write -g KeyRepeat -int 1
defaults write -g InitialKeyRepeat -int 15
# install + set up brew
BREWPATH=""
ARCH=$(arch)
if [ "$ARCH" = "arm64" ]; then
BREWPATH="/opt/homebrew/bin/brew"
else
BREWPATH="/usr/local/bin/brew"
fi
if [ ! -f "$BREWPATH" ]; then
echo "Installing brew because '$BREWPATH' does not exist"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
BREW_STATUS=0
which -s brew > /dev/null 2>&1 || BREW_STATUS=$?
if [[ $BREW_STATUS != 0 ]] ; then
echo "Set up brew shellenv"
eval "$($BREWPATH shellenv)"
fi
# install stuff
brew update --quiet && brew install diff-so-fancy git zsh sheldon fzf python3 pyenv jq openssl starship neovim nvm zig wasmtime wabt fd withgraphite/tap/graphite
brew install --cask temurin temurin@11 temurin@21
# install xcode-select
XCODE_SELECT_STATUS=0
xcode-select --install > /dev/null 2>&1 || XCODE_SELECT_STATUS=$?
# install volta
curl -fsS https://get.volta.sh | bash
# initialize sheldon
echo "Installing Sheldon"
rsync -u ./sheldon/plugins.toml "$HOME/.config/sheldon/plugins.toml"
echo "Set up local plugins"
mkdir -p "$HOME/.zsh_local_plugins"
rsync -a -u ./plugins/ "$HOME/.zsh_local_plugins/"
# graphite
if whence gt >/dev/null 2>&1; then
mkdir -p "$HOME/.zsh_local_plugins/graphite-completions"
gt completion zsh > "$HOME/.zsh_local_plugins/graphite-completions/gt.plugin.zsh"
fi
sheldon lock
# install node and yarn
"$HOME/.volta/bin/volta" install node npm yarn
# profile files
echo "Set up zprofile"
rsync -u ./.zprofile "$HOME/.zprofile"
echo "Set up zshrc"
rsync -u ./.zshrc "$HOME/.zshrc"
echo "Set up editor helper"
mkdir -p "$HOME/.zsh_utils"
rsync -u ./editor.zsh "$HOME/.zsh_utils/editor.zsh"
# starship stuff
echo "Set up starship"
mkdir -p "$HOME/.starship/cache"
rsync -u ./starship.toml "$HOME/.starship/"
# iterm stuff - make sure to import into iterm
echo "Set up iterm config"
mkdir -p "$HOME/.iterm2"
rsync -u ./com.googlecode.iterm2.plist "$HOME/.iterm2/"
# git configuration
echo "Set up git config"
git config --global user.email 'matthew.burghoffer@ironcladhq.com'
git config --global user.name 'Matthew Burghoffer'
git config --global pull.default 'current'
git config --global push.default 'current'
git config --global checkout.defaultRemote 'origin'
git config --global --type=bool checkout.autoSetupRemote 'true'
git config --global core.editor 'nvim'
git config --global diff.tool 'vscode'
git config --global difftool.vscode.cmd 'code --wait --diff $LOCAL $REMOTE'
git config --global merge.tool 'vscode'
git config --global mergetool.vscode.cmd 'code --wait $MERGED'
git config --global pull.ff 'only'
git config --global alias.set-upstream '!git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`'
## git diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=2 -RF"
git config --global interactive.diffFilter "diff-so-fancy --patch"
git config --global --type=bool color.ui true
git config --global color.diff-highlight.oldNormal "red bold"
git config --global color.diff-highlight.oldHighlight "red bold 52"
git config --global color.diff-highlight.newNormal "green bold"
git config --global color.diff-highlight.newHighlight "green bold 22"
git config --global color.diff.meta "11"
git config --global color.diff.frag "magenta bold"
git config --global color.diff.func "146 bold"
git config --global color.diff.commit "yellow bold"
git config --global color.diff.old "red bold"
git config --global color.diff.new "green bold"
git config --global color.diff.whitespace "red reverse"