oldgallois.zsh-theme 960 B

123456789101112131415161718192021222324
  1. # Depends on the git plugin for work_in_progress()
  2. (( $+functions[work_in_progress] )) || work_in_progress() {}
  3. ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
  4. ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
  5. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
  6. ZSH_THEME_GIT_PROMPT_CLEAN=""
  7. # Customized git status, oh-my-zsh currently does not allow render dirty status before branch
  8. git_custom_status() {
  9. local branch=$(git_current_branch)
  10. [[ -n "$branch" ]] || return 0
  11. echo "$(parse_git_dirty)\
  12. %{${fg_bold[yellow]}%}$(work_in_progress)%{$reset_color%}\
  13. ${ZSH_THEME_GIT_PROMPT_PREFIX}${branch}${ZSH_THEME_GIT_PROMPT_SUFFIX}"
  14. }
  15. # RVM component of prompt
  16. ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}["
  17. ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}"
  18. # Combine it all into a final right-side prompt
  19. RPS1="\$(git_custom_status)\$(ruby_prompt_info)${RPS1:+ $RPS1}"
  20. PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '