Parent directory

oldgallois.zsh-theme

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