Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created September 11, 2013 00:41
Show Gist options
  • Save ajcrites/6517907 to your computer and use it in GitHub Desktop.
Save ajcrites/6517907 to your computer and use it in GitHub Desktop.
randomize_prompt_color () {
git=$(git_prompt_info)
if [ -n "$git" ]; then
git="$git "
fi
PROMPT="%{$fg_bold[green]%}%n%F{$((RANDOM % 8))}@%{$fg[magenta]%}%m %{$fg_bold[cyan]%}%~ %{$fg_bold[blue]%}$git%{$fg_bold[red]%}%(!.#.\$) %{$reset_color%}"
if [ -n "$VIRTUAL_ENV" ]; then
PROMPT="(pyvenv: $(basename $VIRTUAL_ENV)) $PROMPT"
fi
}
add-zsh-hook precmd randomize_prompt_color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment