Permalink
Browse files

Adding bray.zsh-theme

  • Loading branch information...
1 parent 0c29b92 commit 5ac1847394e70e94a7e3bc96aa9961c66c145011 @bray committed Mar 5, 2012
Showing with 39 additions and 0 deletions.
  1. +39 −0 themes/bray.zsh-theme
View
39 themes/bray.zsh-theme
@@ -0,0 +1,39 @@
+
+# local time, color coded by last return code
+time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
+time_disabled="%{$fg[green]%}%*%{$reset_color%}"
+time=$time_enabled
+
+# Compacted $PWD
+#local pwd="%{$fg[blue]%}%~%{$reset_color%}"
+
+#PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
+#PROMPT='${time} ${pwd} $(git_prompt_info)$ '
+PROMPT='${time} %{$fg[blue]%}${PWD/#$HOME/~}%{$reset_color%} $(git_prompt_info)$ '
+
+ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[yellow]%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
+
+
+# elaborate exitcode on the right when >0
+return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+return_code_disabled=
+return_code=$return_code_enabled
+
+RPS1='${return_code}'
+
+function accept-line-or-clear-warning () {
+ if [[ -z $BUFFER ]]; then
+ time=$time_disabled
+ return_code=$return_code_disabled
+ else
+ time=$time_enabled
+ return_code=$return_code_enabled
+ fi
+ zle accept-line
+}
+zle -N accept-line-or-clear-warning
+bindkey '^M' accept-line-or-clear-warning
+

0 comments on commit 5ac1847

Please sign in to comment.