My macbook setup

April 24, 2020



My terminal with suggestions shown

My terminal with suggestions shown.



For future reference.

General

Essential apps

New directories

mkdir {~/Projects, ~/Library/SDK, ~/.Keys, ~/.MongoDB}

Git

Generate new key and add to Github

ssh-keygen -t rsa -b 4096 -C "email"
eval "$(ssh-agent -s)"
Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/.
ssh-add -K ~/.ssh/.
pbcopy < ~/.ssh/.

Homebrew

Install homebrew to manage mac packages

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Brew cask

Brew packages

Node version manager

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Install latest long-term support version

nvm install --lts

iTerm2 configuration

Under preferences,

Install oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install zsh plugins in plugins folder

Drop .zshrc into ~

# ohmyzsh
export ZSH="/Users/kevin/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(
  git
  zsh-autosuggestions
  fasd
  you-should-use
  auto-ls
  zsh-syntax-highlighting
)

# zsh-autosuggestions
ZSH_AUTOSUGGEST_STRATEGY=(history completion)

# zsh-autols
AUTO_LS_COMMANDS=(ls)

# ALIAS
alias mongod="mongod --dbpath /Users/kevin/.MongoDB/data"

# PATHS
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH="$PATH:/Library/SDK/flutter/bin"
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

# PYENV
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi

# fasd
fasd_cache="$HOME/.fasd-init-bash"
if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
  fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache"
fi
source "$fasd_cache"
unset fasd_cache

source $ZSH/oh-my-zsh.sh

SDKs

All SDKs should be placed in /Library/SDK

Flutter

git clone https://github.com/flutter/flutter.git -b stable