gallois.zsh-theme 822 B

123456789101112131415161718192021
  1. ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
  2. ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
  3. ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
  4. ZSH_THEME_GIT_PROMPT_CLEAN=""
  5. #Customized git status, oh-my-zsh currently does not allow render dirty status before branch
  6. git_custom_status() {
  7. local cb=$(current_branch)
  8. if [ -n "$cb" ]; then
  9. echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
  10. fi
  11. }
  12. # RVM component of prompt
  13. ZSH_THEME_RVM_PROMPT_PREFIX="%{$fg[red]%}["
  14. ZSH_THEME_RVM_PROMPT_SUFFIX="]%{$reset_color%}"
  15. # Combine it all into a final right-side prompt
  16. RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1'
  17. PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '