aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matthew.j.singleton@gmail.com>2011-02-18 19:27:42 -0500
committerMatt Singleton <matthew.j.singleton@gmail.com>2011-02-18 19:27:42 -0500
commit73d5178d105afd5009f217ca551f791837ae7adb (patch)
tree7e9fabfa91e57c2d9381ad4b28f2ce2529e12ad0
parent80c4389f22dd733a31faa6fcf0ed5b4662e9e3b2 (diff)
moving git and svn modules into appearance since it's all prompt related now
-rw-r--r--zsh/appearance.zsh25
-rw-r--r--zsh/git.zsh6
-rw-r--r--zsh/svn.zsh7
3 files changed, 18 insertions, 20 deletions
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}) "
-}