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