Skip to content

Instantly share code, notes, and snippets.

@callummr
Forked from ryanhanwu/Brewfile
Last active April 3, 2021 11:00
Show Gist options
  • Save callummr/753b7cebb026e30919ec9a16c09585cd to your computer and use it in GitHub Desktop.
Save callummr/753b7cebb026e30919ec9a16c09585cd to your computer and use it in GitHub Desktop.
New Mac Setup Script 2021

Basic Setup

git clone https://gist.github.com/callummr/753b7cebb026e30919ec9a16c09585cd.git setup
cd setup && sh ./init.sh

Shell Configuration

  1. Enable plugins - edit ~/.zshrc

    Update plugins

     plugins=(autojump git brew common-aliases zsh-autosuggestions copydir copyfile encode64 node osx sublime tmux xcode pod docker git-extras git-prompt)
    

Generate Your Development SSH Key

  1. Generate your key for the development machine

    ssh-keygen -t rsa -b 2048
    
# Taps
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
# Utils
brew 'coreutils'
brew 'findutils'
brew 'bat'
brew 'zsh'
brew 'zsh-completions'
brew 'htop'
brew 'wget'
brew 'tree'
brew 'mas'
brew 'trash'
brew 'diff-so-fancy'
brew 'git'
brew 'awscli'
brew 'nvm'
brew 'pyenv'
# Mac Apps
## Communication
cask 'slack'
## Productivity
cask 'alfred'
cask 'docker'
cask 'google-chrome'
cask 'firefox'
cask 'rectangle'
cask 'cheatsheet'
cask 'todoist'
## System
cask 'the-unarchiver'
cask 'appcleaner'
## Editor
cask 'visual-studio-code'
brew 'vim'
## Development
cask 'iterm2'
cask 'postman'
cask 'tower'
# Fonts
cask 'font-source-code-pro-for-powerline'
cask 'font-source-code-pro'
cask 'font-source-sans-pro'
# App
mas 'XCode', id: 497799835
mas 'Todoist', id: 585829637
#!/bin/sh
echo "Finder tweaks"
# Show Library Folder in Finder
chflags nohidden ~/Library
# Show Hidden Files in Finder
defaults write com.apple.finder AppleShowAllFiles YES
# Show Path Bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
echo "Installing Homebrew"
if test ! $(which brew); then
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
source ~/.zshrc
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew update
echo "Install Homebrew Packages"
brew tap homebrew/bundle
brew bundle
echo "Installing node, yarn"
nvm install node
npm i -g yarn
echo "Install XCode CLI Tool"
xcode-select --install
echo "Installing Oh My Zsh"
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
echo "source ~/.oh-my-zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
sed -io 's/^plugins=.*/plugins=(git brew zsh-autosuggestions osx)/' ~/.zshrc
sed -io 's/^ZSH_THEME.*/ZSH_THEME="agnoster"/' ~/.zshrc
echo "Configuring Git"
git config --global core.editor $(which vim)
## diff-so-fancy config
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
git config --global interactive.diffFilter "diff-so-fancy --patch"
git config --global color.ui true
git config --global color.diff-highlight.oldNormal "red bold"
git config --global color.diff-highlight.oldHighlight "red bold 52"
git config --global color.diff-highlight.newNormal "green bold"
git config --global color.diff-highlight.newHighlight "green bold 22"
git config --global color.diff.meta "11"
git config --global color.diff.frag "magenta bold"
git config --global color.diff.func "146 bold"
git config --global color.diff.commit "yellow bold"
git config --global color.diff.old "red bold"
git config --global color.diff.new "green bold"
git config --global color.diff.whitespace "red reverse"
echo "Enabling Services"
open /Applications/Alfred\ 4.app
open /Applications/Rectangle.app
#!/bin/sh
git pull
echo "Updating Homebrew"
brew update && brew upgrade && brew cleanup && brew cask cleanup; brew bundle; brew doctor
echo "Updating Oh My Zsh"
env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment