my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
960 B

3 years ago
  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 '