208b225a2f12076099255c329abbb3569723b39b

Author
Juan G. Hurtado <juan.g.hurtado@gmail.com>
Committer
Juan G. Hurtado <juan.g.hurtado@gmail.com>
Date

Message

Custom theme with Git support

This is my personal oh-my-zsh theme. It has Git support through
methods found in Git lib file of oh-my-zsh. It uses:

- parse_git_dirty()
- git_prompt_ahead()
- current_branch()
- git_prompt_short_sha()
- git_prompt_status()

It also shows user name, machine name and current path. You can
take a look at a screenshot at http://goo.gl/ZVoyk

Diff

 1diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..2f715cc9e6dd606a74f086ca4f4bfa71d3792602
 4--- /dev/null
 5+++ b/themes/juanghurtado.zsh-theme
 6@@ -0,0 +1,46 @@
 7+# ------------------------------------------------------------------------
 8+# Juan G. Hurtado oh-my-zsh theme
 9+# (Needs Git plugin for current_branch method)
10+# ------------------------------------------------------------------------
11+
12+# Color shortcuts
13+RED=$fg[red]
14+YELLOW=$fg[yellow]
15+GREEN=$fg[green]
16+WHITE=$fg[white]
17+BLUE=$fg[blue]
18+RED_BOLD=$fg_bold[red]
19+YELLOW_BOLD=$fg_bold[yellow]
20+GREEN_BOLD=$fg_bold[green]
21+WHITE_BOLD=$fg_bold[white]
22+BLUE_BOLD=$fg_bold[blue]
23+RESET_COLOR=$reset_color
24+
25+# Format for git_prompt_info()
26+ZSH_THEME_GIT_PROMPT_PREFIX=""
27+ZSH_THEME_GIT_PROMPT_SUFFIX=""
28+
29+# Format for parse_git_dirty()
30+ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)"
31+ZSH_THEME_GIT_PROMPT_CLEAN=""
32+
33+# Format for git_prompt_status()
34+ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged"
35+ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted"
36+ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed"
37+ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified"
38+ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added"
39+ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked"
40+
41+# Format for git_prompt_ahead()
42+ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)"
43+
44+# Format for git_prompt_long_sha() and git_prompt_short_sha()
45+ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}"
46+ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]"
47+
48+# Prompt format
49+PROMPT='
50+%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%}
51+%{$BLUE%}>%{$RESET_COLOR%} '
52+RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'