Skip to content

Instantly share code, notes, and snippets.

@mtully
Created July 31, 2012 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtully/3213508 to your computer and use it in GitHub Desktop.
Save mtully/3213508 to your computer and use it in GitHub Desktop.
Theme for Oh-My-Zsh
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(parse_git_dirty)${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
PROMPT='%{$fg[white]%}[%1~$(git_prompt_info)%{$fg[white]%}] %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX=" "
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[yellow]%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment