-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·66 lines (55 loc) · 2.79 KB
/
setup
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
#!/usr/bin/env bash
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile"
eval "$(/opt/homebrew/bin/brew shellenv)"
brew bundle --no-lock >> /dev/null
brew cleanup >> /dev/null
echo "Installing ohmyzsh..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
ln -sfn "$PWD/.zshrc" "$HOME/.zshrc"
echo "Configuring macOS settings..."
sh .macos
echo "Configuring git..."
git config --global commit.gpgsign true
git config --global core.editor vim
git config --global core.ignorecase false
git config --global gpg.format ssh
git config --global merge.tool vimdiff
git config --global pull.rebase true
git config --global fetch.prune true
git config --global init.defaultBranch master
git config --global user.email [email protected]
git config --global user.name "Hugo van de Vliert"
git config --global user.signingkey "$HOME/.ssh/id_ed25519.pub"
# delta settings
git config --global core.pager 'delta --paging always --features "$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark-mode || echo light-mode)"'
git config --global interactive.diffFilter 'delta --color-only --features "$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo dark-mode || echo light-mode)"'
git config --global delta.navigate true
git config --global delta.hyperlinks true
git config --global delta.keep-plus-minus-markers false
git config --global delta.blame-palette normal
git config --global delta.blame-format "{commit:<8} {author:<15.15} {timestamp:<16}"
git config --global delta.blame-timestamp-output-format "%F %R"
git config --global delta.light-mode.light true
git config --global delta.light-mode.syntax-theme "Solarized (light)"
git config --global delta.dark-mode.light false
git config --global delta.dark-mode.syntax-theme "Solarized (dark)"
echo "Configuring iTerm..."
mkdir -p "$HOME/.iterm2"
ln -sfn "$PWD/.iterm2/com.googlecode.iterm2.plist" "$HOME/.iterm2/com.googlecode.iterm2.plist"
echo "Configuring vim..."
cp -R "$PWD/.vim/" "$HOME/.vim"
ln -sfn "$PWD/.vimrc" "$HOME/.vimrc"
vim -Esu "$HOME/.vimrc" +PlugInstall +qall
echo "Configuring ssh..."
mkdir -p "$HOME/.ssh"
ln -sfn "$PWD/.ssh/config" "$HOME/.ssh/config"
echo "Configuring daemon that remaps Caps Lock to Escape..."
mkdir -p ~/Library/LaunchAgents
cp "$PWD/escape-map.plist" ~/Library/LaunchAgents/custom.escape-map.plist
launchctl load -w ~/Library/LaunchAgents/custom.escape-map.plist
echo "Configuring daemon that preloads ssh keys from keychain..."
cp "$PWD/ssh-add.plist" ~/Library/LaunchAgents/custom.ssh-add.plist
launchctl load -w ~/Library/LaunchAgents/custom.ssh-add.plist
echo "Installation complete! Please reboot your machine."