Skip to content

Instantly share code, notes, and snippets.

@joshdholtz
Created October 27, 2021 19:16
Show Gist options
  • Save joshdholtz/d1a7295c51e031a8de7e11c36f25ab61 to your computer and use it in GitHub Desktop.
Save joshdholtz/d1a7295c51e031a8de7e11c36f25ab61 to your computer and use it in GitHub Desktop.

Revisions

  1. joshdholtz created this gist Oct 27, 2021.
    23 changes: 23 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    # ~/.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
    8 changes: 8 additions & 0 deletions joshdholtz.zsh-theme
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # ~/.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]%})"