-
Notifications
You must be signed in to change notification settings - Fork 20
/
programs.sh
executable file
·131 lines (93 loc) · 3.82 KB
/
programs.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env bash
# Like the other install script, this is from Mathias Bynens with slight modifications by me
# https://github.com/mathiasbynens/dotfiles/blob/bb6c76e410bf7b1693edfe60239461fc9205ec02/brew.sh
# Installing oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Make sure we’re using the latest Homebrew.
brew update
# Upgrade any already-installed formulae.
brew upgrade
# Save Homebrew’s installed location.
BREW_PREFIX=$(brew --prefix)
# Use arch -arm64 if using an arm64 chip
INSTALL_CHIP_PREFIX="arch -arm64"
[[ $(uname -m) != "arm64" ]] && INSTALL_CHIP_PREFIX=""
# -------------------------------
# Essential programs
# -------------------------------
# Utils
$(INSTALL_CHIP_PREFIX) brew install wget
$(INSTALL_CHIP_PREFIX) brew install curl
# Alacritty
$(INSTALL_CHIP_PREFIX) brew install alacritty
# Git
$(INSTALL_CHIP_PREFIX) brew install git
$(INSTALL_CHIP_PREFIX) brew install git-lfs
$(INSTALL_CHIP_PREFIX) brew install docker
$(INSTALL_CHIP_PREFIX) brew install docker-compose
$(INSTALL_CHIP_PREFIX) brew install docker-machine
# Install more recent versions of some macOS tools.
$(INSTALL_CHIP_PREFIX) brew install grep
$(INSTALL_CHIP_PREFIX) brew install openssh
$(INSTALL_CHIP_PREFIX) brew install ssh-copy-id
$(INSTALL_CHIP_PREFIX) brew install gnu-sed
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed.
$(INSTALL_CHIP_PREFIX) brew install findutils
# Install GnuPG to enable PGP-signing commits.
$(INSTALL_CHIP_PREFIX) brew install gnupg
# This is needed for Telescope to be able to do live greps
# It is also a good CLI tool (faster than ag in many cases)
$(INSTALL_CHIP_PREFIX) brew install ripgrep
# Remove outdated versions from the cellar.
brew cleanup
# -------------------------------
# Text editing
# -------------------------------
# Change the user's life forever
# God bless the best text editor on earth
$(INSTALL_CHIP_PREFIX) brew install neovim
# Install vim-plug before installing plugins themselves
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
# Install nvim plugins
nvim +PlugClean! +qall
nvim +GoInstallBinaries
nvim +silent +PlugInstall +qall
# vim's best friend
$(INSTALL_CHIP_PREFIX) brew install tmux
# install what's necessary for tmux to use
$(INSTALL_CHIP_PREFIX) brew install reattach-to-user-namespace
# install tmux plugin manager
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# -------------------------------
# JS-related
# -------------------------------
# Install nvm and Node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install node
# -------------------------------
# Rust-related
# -------------------------------
# Installing rustup (for managing Rust)
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
# Add necessary extensions for CoC support
rustup component add rls rust-analysis rust-src
# -------------------------------
# ZSH-related
# -------------------------------
# This installs the spaceship theme for zsh
# https://github.com/denysdovhan/spaceship-prompt
if [ -d "$ZSH/custom/themes/spaceship-prompt" ]
then
echo "spaceship-prompt is already installed, skipping..."
else
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH/custom/themes/spaceship-prompt"
ln -s "$ZSH/custom/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH/custom/themes/spaceship.zsh-theme"
fi
# -------------------------------
# Casks
# -------------------------------
for i in $(cat ./Cask); do $(INSTALL_CHIP_PREFIX) brew install "$i"; done