Skip to content

Instantly share code, notes, and snippets.

@diaswrd
Created March 23, 2023 18:56
Show Gist options
  • Save diaswrd/5287af725ecb39f2f39880e97f6d6409 to your computer and use it in GitHub Desktop.
Save diaswrd/5287af725ecb39f2f39880e97f6d6409 to your computer and use it in GitHub Desktop.
Pleasant green/purple font colors in ~/.zprofile for iterm2 (with git branch name)
# Set CLICOLOR if you want Ansi Colors in iTerm2
export CLICOLOR=1
# Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/(\1)/p'
}
COLOR_DEF=$'%f'
COLOR_USR=$'%F{243}'
COLOR_DIR=$'%F{green}'
COLOR_GIT=$'%F{141}'
setopt PROMPT_SUBST
export PROMPT='${COLOR_USR}%n ${COLOR_DIR}%~ ${COLOR_GIT}$(parse_git_branch)${COLOR_DEF} $ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment