c52e646bb7b109e15f6dc4047b29ca8c8e029433
- Author
- Marc Cornellà <hello@mcornella.com>
- Committer
- Marc Cornellà <hello@mcornella.com>
- Date
Message
refactor(gallois): clean up theme and fix typos
Diff
1diff --git a/themes/gallois.zsh-theme b/themes/gallois.zsh-theme
2index e6c2d81426d287ede3e827a4d82f8d752c84d5ee..bb97bfb1782cc47f6faaf97cfbb5c0485a907b33 100644
3--- a/themes/gallois.zsh-theme
4+++ b/themes/gallois.zsh-theme
5@@ -1,16 +1,18 @@
6 # Depends on the git plugin for work_in_progress()
7+(( $+functions[work_in_progress] )) || work_in_progress() {}
8
9 ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
10 ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
11 ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
12 ZSH_THEME_GIT_PROMPT_CLEAN=""
13
14-#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
15+# Customized git status, oh-my-zsh currently does not allow render dirty status before branch
16 git_custom_status() {
17- local cb=$(git_current_branch)
18- if [ -n "$cb" ]; then
19- echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
20- fi
21+ local branch=$(git_current_branch)
22+ [[ -n "$branch" ]] || return 0
23+ echo "$(parse_git_dirty)\
24+%{${fg_bold[yellow]}%}$(work_in_progress)%{$reset_color%}\
25+${ZSH_THEME_GIT_PROMPT_PREFIX}${branch}${ZSH_THEME_GIT_PROMPT_SUFFIX}"
26 }
27
28 # RVM component of prompt
29@@ -18,6 +20,5 @@ ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg[red]%}["
30 ZSH_THEME_RUBY_PROMPT_SUFFIX="]%{$reset_color%}"
31
32 # Combine it all into a final right-side prompt
33-RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1'
34-
35+RPS1="\$(git_custom_status)\$(ruby_prompt_info)${RPS1:+ $RPS1}"
36 PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '