Last active
July 27, 2018 07:37
-
-
Save xykj61/ee91219d83b9b7e09d6fe8cf6274ae77 to your computer and use it in GitHub Desktop.
macOS fresh setup.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Initial setup | |
cd ~; | |
# macOS defaults | |
# h/t https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
## Disable press-and-hold for keys in favor of key repeat | |
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false; | |
## Set a blazingly fast keyboard repeat rate | |
defaults write NSGlobalDomain KeyRepeat -int 1; | |
defaults write NSGlobalDomain InitialKeyRepeat -int 10; | |
## Require password immediately after sleep or screen saver begins | |
defaults write com.apple.screensaver askForPassword -int 1; | |
defaults write com.apple.screensaver askForPasswordDelay -int 0; | |
## Save screenshots to the desktop | |
defaults write com.apple.screencapture location -string "${HOME}/Desktop"; | |
## Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) | |
defaults write com.apple.screencapture type -string "png"; | |
## Disable shadow in screenshots | |
defaults write com.apple.screencapture disable-shadow -bool true; | |
# Install Homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; | |
# Update Homebrew | |
brew update; | |
# Install Tmux | |
brew install tmux; | |
# Install Tmux Package Manager (tpm) | |
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm; | |
# Set up ~/.tmux.conf | |
printf "# List of plugins\nset -g @plugin 'tmux-plugins/tpm'\nset -g @plugin 'tmux-plugins/tmux-sensible'\nset -g @plugin 'tmux-plugins/tmux-resurrect'\n\n# Other examples:\n# set -g @plugin 'github_username/plugin_name'\n# set -g @plugin 'git@github.com/user/plugin'\n# set -g @plugin 'git@bitbucket.com/user/plugin'\n\n# Additional programs to restore\nset -g @resurrect-processes 'urbit'\n\n# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)\nrun '~/.tmux/plugins/tpm/tpm'\n" >> ~/.tmux.conf; | |
# Create Tmux session and attach to it | |
tmux new-session -s macos; | |
# Install Homebrew packages | |
brew install \ | |
ack | |
asciinema | |
bash | |
git | |
hub | |
neovim; | |
# Set uo global Git configuration | |
git config --global user.name "Keaton Dunsford"; | |
git config --global user.email "keaton@tlon.io"; | |
git config --global core.editor "nvim"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment