Revisions
-
uasi revised this gist
Apr 12, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ setopt re_match_pcre function rprompt-git-current-branch { local name st color gitdir action if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then return fi name=`git rev-parse --abbrev-ref=loose HEAD 2> /dev/null` -
uasi revised this gist
Apr 12, 2012 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,9 @@ autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null setopt prompt_subst setopt re_match_pcre function rprompt-git-current-branch { local name st color gitdir action if [[ "$PWD" =~ '/¥.git(/.*)?$' ]]; then @@ -18,19 +21,18 @@ function rprompt-git-current-branch { action=`VCS_INFO_git_getaction "$gitdir"` && action="($action)" st=`git status 2> /dev/null` if [[ "$st" =~ "(?m)^nothing to" ]]; then color=%F{green} elif [[ "$st" =~ "(?m)^nothing added" ]]; then color=%F{yellow} elif [[ "$st" =~ "(?m)^# Untracked" ]]; then color=%B%F{red} else color=%F{red} fi echo "$color$name$action%f%b " } RPROMPT='[`rprompt-git-current-branch`%~]' -
uasi revised this gist
Apr 12, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function rprompt-git-current-branch { if [[ "$PWD" =~ '/¥.git(/.*)?$' ]]; then return fi name=`git rev-parse --abbrev-ref=loose HEAD 2> /dev/null` if [[ -z $name ]]; then return fi -
uasi revised this gist
Dec 28, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function rprompt-git-current-branch { if [[ "$PWD" =~ '/¥.git(/.*)?$' ]]; then return fi name=$(basename "`git symbolic-ref HEAD 2> /dev/null`") if [[ -z $name ]]; then return fi -
uasi revised this gist
Oct 25, 2009 . 1 changed file with 15 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,30 +2,33 @@ # Show branch name in Zsh's right prompt # autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null function rprompt-git-current-branch { local name st color gitdir action if [[ "$PWD" =~ '/¥.git(/.*)?$' ]]; then return fi name=`git branch 2> /dev/null | grep '^¥*' | cut -b 3-` if [[ -z $name ]]; then return fi gitdir=`git rev-parse --git-dir 2> /dev/null` action=`VCS_INFO_git_getaction "$gitdir"` && action="($action)" st=`git status 2> /dev/null` if [[ -n `echo "$st" | grep "^nothing to"` ]]; then color=%F{green} elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then color=%F{yellow} elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then color=%B%F{red} else color=%F{red} fi echo "$color$name$action%f%b " } setopt prompt_subst -
uasi revised this gist
Oct 25, 2009 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,9 @@ autoload -U colors; colors function rprompt-git-current-branch { local name st color if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then return fi name=`git branch 2> /dev/null | grep '^¥*' | cut -b 3-` if [[ -z $name ]]; then return -
uasi created this gist
Oct 20, 2009 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ # # Show branch name in Zsh's right prompt # autoload -U colors; colors function rprompt-git-current-branch { local name st color name=`git branch 2> /dev/null | grep '^¥*' | cut -b 3-` if [[ -z $name ]]; then return fi st=`git status` if [[ -n `echo "$st" | grep "^nothing to"` ]]; then color=${fg[green]} elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then color=${fg[yellow]} elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then color=${fg_bold[red]} else color=${fg[red]} fi echo "%{$color%}$name%{$reset_color%} " } setopt prompt_subst RPROMPT='[`rprompt-git-current-branch`%~]'