38ef5192cb1c43159b516d15ab8fed96f847b36b

Author
Felipe Gallois <gallois@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(oldgalois): add theme (#11880)

Closes #11879

Diff

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