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