diff options
author | Juan G. Hurtado <juan.g.hurtado@gmail.com> | 2011-04-29 13:11:38 +0200 |
---|---|---|
committer | Juan G. Hurtado <juan.g.hurtado@gmail.com> | 2011-04-29 13:11:38 +0200 |
commit | 208b225a2f12076099255c329abbb3569723b39b (patch) | |
tree | bd269be97268ebe942806ebfe787587051152745 /themes/juanghurtado.zsh-theme | |
parent | 077baa7bb1aba75d3005b7c6e5df4f53e0ea15d1 (diff) | |
download | zsh-208b225a2f12076099255c329abbb3569723b39b.tar.gz zsh-208b225a2f12076099255c329abbb3569723b39b.tar.bz2 zsh-208b225a2f12076099255c329abbb3569723b39b.zip |
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
Diffstat (limited to 'themes/juanghurtado.zsh-theme')
-rw-r--r-- | themes/juanghurtado.zsh-theme | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/themes/juanghurtado.zsh-theme b/themes/juanghurtado.zsh-theme new file mode 100644 index 000000000..2f715cc9e --- /dev/null +++ b/themes/juanghurtado.zsh-theme @@ -0,0 +1,46 @@ +# ------------------------------------------------------------------------ +# Juan G. Hurtado oh-my-zsh theme +# (Needs Git plugin for current_branch method) +# ------------------------------------------------------------------------ + +# Color shortcuts +RED=$fg[red] +YELLOW=$fg[yellow] +GREEN=$fg[green] +WHITE=$fg[white] +BLUE=$fg[blue] +RED_BOLD=$fg_bold[red] +YELLOW_BOLD=$fg_bold[yellow] +GREEN_BOLD=$fg_bold[green] +WHITE_BOLD=$fg_bold[white] +BLUE_BOLD=$fg_bold[blue] +RESET_COLOR=$reset_color + +# Format for git_prompt_info() +ZSH_THEME_GIT_PROMPT_PREFIX="" +ZSH_THEME_GIT_PROMPT_SUFFIX="" + +# Format for parse_git_dirty() +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$RED%}(*)" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +# Format for git_prompt_status() +ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged" +ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted" +ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed" +ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified" +ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added" +ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked" + +# Format for git_prompt_ahead() +ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)" + +# Format for git_prompt_long_sha() and git_prompt_short_sha() +ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$WHITE%}[%{$YELLOW%}" +ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$WHITE%}]" + +# Prompt format +PROMPT=' +%{$GREEN_BOLD%}%n@%m%{$WHITE%}:%{$YELLOW%}%~%u$(parse_git_dirty)$(git_prompt_ahead)%{$RESET_COLOR%} +%{$BLUE%}>%{$RESET_COLOR%} ' +RPROMPT='%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)%{$RESET_COLOR%}'
\ No newline at end of file |