-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·75 lines (63 loc) · 1.87 KB
/
init.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
71
72
73
74
75
#!/usr/bin/env bash
symlink() {
# A symlink function that makes sure the target symlink's parent path
# exists.
# Expand ~ to $HOME if present
local source="${1/#\~/$HOME}"
local target="${2/#\~/$HOME}"
[[ -e ${target} ]] && echo "'${target}' exists, skipping" && return
mkdir -p "$(dirname ${target})"
ln -s "${source}" "${target}"
}
install_prereqs() {
# check to see if brew is installed. Install it if it isn't already
if ! which brew &> /dev/null; then
echo 'Installing `brew` package manager: https://brew.sh/'
echo 'Requires user password'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Install packages
echo "Installing packages with brew"
brew install \
neovim \
tmux \
fzf \
ripgrep \
ranger \
cmake \
gcc \
gh \
exa \
bat \
zoxide \
fish \
starship \
fd \
bat \
git-delta \
shortcat
brew tap wez/wezterm
brew install --cask wez/wezterm/wezterm
# Install hammerspoon and ControlEscape spoon
mkdir -p ~/.hammerspoon/Spoons
git clone https://github.com/jasonrudolph/ControlEscape.spoon.git ~/.hammerspoon/Spoons/ControlEscape.spoon
cd ~/.hammerspoon/Spoons/ControlEscape.spoon
script/setup
}
link_files() {
local readonly dotfiles="${HOME}/dotfiles"
# sync all the things
symlink "${dotfiles}/bash_aliases" ~/.bash_aliases
symlink "${dotfiles}/bash_profile" ~/.bash_profile
symlink "${dotfiles}/tmux.conf" ~/.tmux.conf
symlink "${dotfiles}/nvim" ~/.config/nvim
symlink "${dotfiles}/gitconfig" ~/.gitconfig
symlink "${dotfiles}/wezterm" ~/.config/wezterm
symlink "${dotfiles}/config.fish" ~/.config/fish/config.fish
symlink "${dotfiles}/fish_plugins" ~/.config/fish/fish_plugins
}
init() {
install_prereqs
link_files
}
init