From 73d5178d105afd5009f217ca551f791837ae7adb Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Fri, 18 Feb 2011 19:27:42 -0500 Subject: moving git and svn modules into appearance since it's all prompt related now --- zsh/appearance.zsh | 25 ++++++++++++++++++------- zsh/git.zsh | 6 ------ zsh/svn.zsh | 7 ------- 3 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 zsh/git.zsh delete mode 100644 zsh/svn.zsh (limited to 'zsh') diff --git a/zsh/appearance.zsh b/zsh/appearance.zsh index 408bc1b..f360985 100644 --- a/zsh/appearance.zsh +++ b/zsh/appearance.zsh @@ -22,12 +22,6 @@ function theme_preexec () { echo "($fg[magenta]`date +%r`$reset_color) $fg[cyan]$3$reset_color" } -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - svn info >/dev/null 2>/dev/null && echo 'ϟ' && return - echo '$' -} - function return_code { code=$(echo $?) if [[ $code == "0" ]]; then @@ -37,5 +31,22 @@ function return_code { fi } +function svn_prompt_info { + info=$(svn info 2>/dev/null) || return + rev=$(echo "$info" | grep Revision | sed 's/Revision: //') + echo "(r${rev}) " +} + +function git_prompt_info { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "(${ref#refs/heads/}) " +} + +function prompt_char { + git branch >/dev/null 2>/dev/null && echo '±' && return + svn info >/dev/null 2>/dev/null && echo 'ϟ' && return + echo '$' +} + PROMPT='%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[green]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%} -$(return_code)$(svn_prompt_info)$(git_prompt_info)$(prompt_char) %{$reset_color%}' +$(return_code)$(svn_prompt_info)$(git_prompt_info)$(prompt_char)%{$reset_color%} ' diff --git a/zsh/git.zsh b/zsh/git.zsh deleted file mode 100644 index e20ef91..0000000 --- a/zsh/git.zsh +++ /dev/null @@ -1,6 +0,0 @@ -#done - -function git_prompt_info { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo "(${ref#refs/heads/}) " -} diff --git a/zsh/svn.zsh b/zsh/svn.zsh deleted file mode 100644 index f542374..0000000 --- a/zsh/svn.zsh +++ /dev/null @@ -1,7 +0,0 @@ -#done - -function svn_prompt_info { - info=$(svn info 2>/dev/null) || return - rev=$(echo "$info" | grep Revision | sed 's/Revision: //') - echo "(r${rev}) " -} -- cgit v1.2.3