-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
189 lines (148 loc) · 7.31 KB
/
setup
File metadata and controls
189 lines (148 loc) · 7.31 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/usr/bin/env bash
# practically everything here is copied from somewhere else
# exit script if any command fails
set -e
# print each line before running
set -x
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v # Keep-alive: update existing `sudo` time stamp until setup has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# Mac system preferences #
###############################################################################
# Disable the 'Are you sure you want to open this application?' dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# add sound effect back
# sudo nvram -d SystemAudioVolume
# Disable Dashboard
# defaults write com.apple.dashboard mcx-disabled -bool true
# Don’t show Dashboard as a Space
# defaults write com.apple.dock dashboard-in-overlay -bool true
# (Use karabiner instead) Set a blazingly fast keyboard repeat rate
# defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
# defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
###############################################################################
# Brew #
###############################################################################
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bash_profile
brew doctor
brew update
brew upgrade --all
brew install fd # required for zshrc's fzf customization
brew install ripgrep
brew install ag
brew install zsh
brew install git
brew install tmux
brew install reattach-to-user-namespace
brew install python
brew install python3
brew install neovim
# for the youcompleteme vim plugin
brew install cmake
brew install gnupg2
brew install fzf
/usr/local/opt/fzf/install
brew install z
brew tap universal-ctags/universal-ctags
brew install --HEAD universal-ctags
brew install ranger
brew install rename
brew install youtube-dl
brew install unrar
brew install coreutils
brew install pass
brew install aws-cli
brew install wget
brew install tig
###############################################################################
# Apps #
###############################################################################
brew cask install --appdir="$HOME/Applications" iterm2
brew cask install --appdir="/Applications" firefox
brew cask install --appdir="/Applications" skim
brew cask install --appdir="/Applications" vlc
brew cask install --appdir="/Applications" google-chrome
brew cask install --appdir="/Applications" vagrant
brew cask install --appdir="/Applications" spotify
brew cask install --appdir="/Applications" shiftit
brew cask install --appdir="/Applications" transmission
brew cask install google-cloud-sdk
defaults write -app Skim SKAutoReloadFileUpdate -boolean true
###############################################################################
# Git setup #
###############################################################################
git config --global user.name "Zhiyan Foo"
git config --global user.email "zhiyanfoo@gmail.com"
git config --global credential.helper osxkeychain
###############################################################################
# ruby version manager #
###############################################################################
\curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles
###############################################################################
# dotfiles #
###############################################################################
git clone "https://github.com/zhiyanfoo/dotfiles" $HOME/dotfiles
ln -s $HOME/dotfiles/aliases $HOME/.aliases
rm $HOME/.bash_profile
ln -s $HOME/dotfiles/bash_profile $HOME/.bash_profile
ln -s $HOME/dotfiles/commonprofile $HOME/.commonprofile
ln -s $HOME/dotfiles/functions $HOME/.functions
ln -s $HOME/dotfiles/tmux.conf $HOME/.tmux.conf
ln -s $HOME/dotfiles/vimrc $HOME/.vimrc
ln -s $HOME/dotfiles/zshrc $HOME/.zshrc
ln -s $HOME/dotfiles/global_gitignore $HOME/.global_gitignore
ln -s $HOME/dotfiles/nvimlispwords.lua $HOME/.config/nvimlispwords.lua
ln -s $HOME/dotfiles/ripgreprc $HOME/.config/ripgreprc
ln -s $HOME/dotfiles/snippets $HOME/.config/nvim/snippets
git config --global core.excludesfile $HOME/.global_gitignore
mkdir -p $HOME/.config/nvim/
ln -s $HOME/dotfiles/nvim_init.vim $HOME/.config/nvim/init.vim
ln -s $HOME/dotfiles/zsh-completion $HOME/.zsh-completion
# let nvim find ftplugins
mkdir -p $HOME/.config/nvim/after
ln -s $HOME/dotfiles/ftplugin $HOME/.config/nvim/after/ftplugin
###############################################################################
# ZEN PYTHON ENVIROMENT MANAGER #
###############################################################################
git clone "https://github.com/zhiyanfoo/zen" $HOME/tools/zen
./$HOME/tools/zen/installation.sh
source /usr/local/bin/zen create repl
source /usr/local/bin/zen use repl
/usr/local/bin/pip3 install ipython
/usr/local/bin/pip3 install bpython
source /usr/local/bin/zen create neovim
source /usr/local/bin/zen use neovim
/usr/local/bin/pip3 install neovim
deactivate
###############################################################################
# vim plugins #
###############################################################################
git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
source .aliases
vim -c 'PluginInstall'
###############################################################################
# Colorscheme #
##############################################################################
# Load into iterm manually
mkdir -p $HOME/tools
git clone "https://github.com/altercation/solarized" $HOME/tools/solarized
###############################################################################
# Secrets #
###############################################################################
mkdir $HOME/.secrets
touch $HOME/..secrets/secrets