Skip to content

Instantly share code, notes, and snippets.

@joshdholtz
Created October 27, 2021 19:16
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save joshdholtz/d1a7295c51e031a8de7e11c36f25ab61 to your computer and use it in GitHub Desktop.
Save joshdholtz/d1a7295c51e031a8de7e11c36f25ab61 to your computer and use it in GitHub Desktop.
Josh's M1 Mac Development Environment - homebrew, zsh
# ~/.zshrc
ZSH_DISABLE_COMPFIX=true
export ZSH="/Users/joshholtz/.oh-my-zsh"
# joshdholtz theme shows arch type in the prompt
ZSH_THEME="joshdholtz"
plugins=(git)
source $ZSH/oh-my-zsh.sh
# M1 and Rosetta
alias mzsh="arch -arm64 zsh"
alias izsh="arch -x86_64 zsh"
if [ "$(uname -p)" = "i386" ]; then
echo "Running in i386 mode (Rosetta)"
eval "$(/usr/local/homebrew/bin/brew shellenv)"
alias brew='/usr/local/homebrew/bin/brew'
else
echo "Running in ARM mode (M1)"
eval "$(/opt/homebrew/bin/brew shellenv)"
alias brew='/opt/homebrew/bin/brew'
fi
# ~/.oh-my-zsh/themes/joshdholtz.zsh-theme
PROMPT="%(?:%{$fg_bold[green]%}➜ $(arch) :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment