Skip to content

Instantly share code, notes, and snippets.

@GoranLilja
Last active December 28, 2021 21:15
Show Gist options
  • Save GoranLilja/9db68f65d36e61a3278f6a583271ae68 to your computer and use it in GitHub Desktop.
Save GoranLilja/9db68f65d36e61a3278f6a583271ae68 to your computer and use it in GitHub Desktop.
MacBook setup
# Open application (or file with application)
alias vscode='open -a "Visual Studio Code"'
# Shortcut for editing this file
alias envedit='vscode /Users/goranlilja/.zshenv'
# Hide/show desktop icons
alias hideicons='defaults write com.apple.finder CreateDesktop false; killall Finder'
alias showicons='defaults write com.apple.finder CreateDesktop true; killall Finder'
# Jump directly to directories
alias code='cd ~/Code'
# Delete Xcode's Derived Data folder
alias ddd='rm -rf ~/Library/Developer/Xcode/DerivedData && echo "Xcode Derived Data cleared"'
# Stitch images together
alias stitch='convert +append'
# It never hurts to be polite
alias please='sudo'
# Git shortcuts
alias ga='git add --all'
alias gb='git branch'
alias gcm='git commit -m'
alias gcne='git commit --amend --no-edit'
alias gco='git checkout'
alias gd='git diff'
alias gdh='git diff HEAD'
alias gdno='git diff --name-only HEAD'
alias gf='git fetch'
alias gl='git log'
alias gr='git reset'
alias grh='git reset --hard HEAD'
alias gs='git status'
alias gsl='git stash list'
alias gsp='git stash pop'
alias gss='git stash save'
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$HOME/.gem/ruby/2.6.0/bin:$PATH
export PATH=$HOME/.composer/vendor/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/goranlilja/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
ddd(){
rm -rf ~/Library/Developer/Xcode/DerivedData
echo "Removed all derived data."
}
export PATH="$HOME/.gem/ruby/2.6.0/bin/:$PATH"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update
brew cask install 1password
brew cask install asana
brew cask install autodesk-fusion360
brew cask install charles
brew cask install db-browser-for-sqlite
brew cask install isimulator
brew cask install iterm2
brew cask install lulu
brew cask install notion
brew cask install obs
brew cask install paw
brew cask install signal
brew cask install slack
brew cask install sourcetree
brew cask install telegram
brew cask toggl-track
brew cask install visual-studio-code
brew cask install zoomus
brew install cocoapods
brew install fastlane
brew install firefox
# Currently evaluating:
brew cask install docker
brew cask install spectacle
brew install robotsandpencils/made/xcodes
# Lokalise
brew tap lokalise/cli-2
brew install lokalise2

Set up global keyboard shortcuts

  • Open System preferences
  • Go to Keyboard
  • Select Shortcuts
  • Under Keyboard, look for "Move focus to next window"
  • Change keyboard shortcut to whatever you want, e.g. +§.

Xcode shortcuts

  • Open Preferences, +,.
  • Go to Key Bindings.
  • Look for "Show Document Items".
  • Change keyboard shortcut to +++O.

Generate SSH key

  • Run ssh-keygen -t rsa -b 2048.
  • Copy to pasteboard pbcopy < ~/.ssh/id_rsa.pub.

Change default git config

git config --global init.defaultBranch main
git config --global core.editor nano

Change keyboard settings

In System preferences, open the Keyboard pref pane.

  • Set Key Repeat to fastest.
  • Set Delay Until Repeat to shortest.
  • Change Touch Bar to show "Expanded control strip"

Change mouse settings

In System preferences, open the Mouse pref pane.

  • Enable Secondary click

Change trackpad settings

In System preferences, open the Trackpad pref pane.

  • Set the Tracking speed to 7

Change Safari settings

In Preferences

  • Set "Remove history items" to "Manually"
  • Uncheck all AutoFill options
  • Uncheck Open "safe" files after downloading
  • Under Advanced, check "Show full website address"
  • Under Advanced, check "Show Develop menu in menu bar"

Change Bluetooth settings

Open the Bluetooth pref pane

  • Check the "Show Bluetooth in menu bar" checkbox

Change Sound settings

Open the Sound pref pane

  • Check the "Show Sound in menu bar" checkbox

Change Spotlight settings

Open the Spotlight pref pane

  • Uncheck all alternatives except "Applications", "Calculator", "Conversion" and "System Preferences".

Change Clock settings

Open the Dock & Menu Bar pref pane, under "Menu Bar Only"

  • Check the "Flash the time separators" checkbox
  • Check the "Display the time with seconds" checkbox

Only show running apps in dock

defaults write com.apple.dock static-only -bool true; killall Dock

Xcode keyboard shortcuts

Shortcut Description
⌘ + ⇧ + J Show file in project explorer
⌘ + ⇧ + H Show Human interface guide in Safari
⌘ + ⇧ + O Open Spotlight for Xcode
⌘ + ⇧ + ⌥ + O Show Document Items (custom)

Setting up Xcode preferences

  • Text Editing
    • Display
    • Enable Code folding ribbon
    • Enable Page guide at column: 120
    • Editing
      • Enable whitespace trimming including whitespace-only lines
  • Editor
    • Invisibles
cask_args appdir: '/Applications'
tap 'homebrew/bundle'
tap 'homebrew/cask'
tap 'homebrew/services'
brew 'cocoapods'
brew 'fastlane'
brew 'firefox'
brew 'git'
brew 'rbenv'
brew 'ruby-build'
cask '1password'
cask 'asana'
cask 'autodesk-fusion360'
cask 'db-browser-for-sqlite'
cask 'charles'
cask 'isimulator'
cask 'iterm2'
cask 'lulu'
cask 'notion'
cask 'obs'
cask 'paw'
cask 'signal'
cask 'slack'
cask 'sourcetree'
cask 'spectacle'
cask 'telegram'
cask 'toggl-track'
cask 'visual-studio-code'
cask 'zoomus'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment