gallois.zsh-theme 1.1 KB

1234567891011121314151617181920212223242526272829
  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 and git settings
  13. if [[ -s ~/.rvm/scripts/rvm ]] ; then
  14. RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1'
  15. else
  16. if which rbenv &> /dev/null; then
  17. RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1'
  18. else
  19. if [[ -n `which chruby_prompt_info` && -n `chruby_prompt_info` ]]; then
  20. RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1'
  21. else
  22. RPS1='$(git_custom_status) $EPS1'
  23. fi
  24. fi
  25. fi
  26. PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '