diff options
author | Christopher Sexton <csexton@gmail.com> | 2009-09-14 12:42:53 -0400 |
---|---|---|
committer | Christopher Sexton <csexton@gmail.com> | 2009-09-14 12:42:53 -0400 |
commit | 85a4e3028990b6583253308ada3d456c291487d7 (patch) | |
tree | 0a5140810bf857cc598516f335662b5a7189a37d /git.zsh | |
parent | 86925121069b2b33be6f3b76034ebcae98b14592 (diff) | |
download | zsh-85a4e3028990b6583253308ada3d456c291487d7.tar.gz zsh-85a4e3028990b6583253308ada3d456c291487d7.tar.bz2 zsh-85a4e3028990b6583253308ada3d456c291487d7.zip |
Added risto theme and made git.zsh themable
* git.zsh is now themable:
* git_prompt_info() now will look in the following variables for
formatting strings:
* ZSH_THEME_GIT_PROMPT_PREFIX - Prefix for the prompt (before the
branch name)
* ZSH_THEME_GIT_PROMPT_SUFFIX - The very end of the prompt
* ZSH_THEME_GIT_PROMPT_DIRTY - Displayed when the branch is dirty
* ZSH_THEME_GIT_PROMPT_CLEAN - Displayed when the branch is clean
* Updated geoffgarside, robbyrussell, and maran to work with new git
theme
* Added the Risto theme, which is very similar to a number of bash
prompts, and allows me to use zsh in with out my co-workers knowing I
have the advantage. Think of it as a ninja theme.
Diffstat (limited to 'git.zsh')
-rw-r--r-- | git.zsh | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,16 +1,26 @@ +# +ZSH_THEME_GIT_PROMPT_PREFIX="git:(" +ZSH_THEME_GIT_PROMPT_SUFFIX=")" +ZSH_THEME_GIT_PROMPT_DIRTY="*" +ZSH_THEME_GIT_PROMPT_CLEAN="" + # get the name of the branch we are on function git_prompt_info() { if [[ -d .git ]]; then ref=$(git symbolic-ref HEAD 2> /dev/null) || return branch=${ref#refs/heads/} - CURRENT_BRANCH="git:(%{$fg[red]%}${branch}%{$fg[blue]%})%{$reset_color%}$(parse_git_dirty)" + CURRENT_BRANCH="$ZSH_THEME_GIT_PROMPT_PREFIX${branch}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" else CURRENT_BRANCH='' fi echo $CURRENT_BRANCH } - parse_git_dirty () { - [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " %{$fg[yellow]%}✗%{$reset_color%}" + if [[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]]; then + echo "$ZSH_THEME_GIT_PROMPT_DIRTY" + else + echo "$ZSH_THEME_GIT_PROMPT_CLEAN" + fi } + |