aboutsummaryrefslogtreecommitdiff
path: root/zsh/appearance.zsh
diff options
context:
space:
mode:
authorMatt Singleton <matthew.j.singleton@gmail.com>2011-03-15 16:14:58 -0400
committerMatt Singleton <matthew.j.singleton@gmail.com>2011-03-15 16:14:58 -0400
commitd93a6701cfad7a099ae8e33f9833a11aaf11c678 (patch)
tree10db593f4ba2802cc28e9a670d630fd727b6b7e2 /zsh/appearance.zsh
parent7ced7d75f22746ed2e94cadebf21a515eb2a8a8d (diff)
make non-local hosts obvious and show a special character for python virtualenv
Diffstat (limited to 'zsh/appearance.zsh')
-rw-r--r--zsh/appearance.zsh20
1 files changed, 18 insertions, 2 deletions
diff --git a/zsh/appearance.zsh b/zsh/appearance.zsh
index 1100c43..edfbd82 100644
--- a/zsh/appearance.zsh
+++ b/zsh/appearance.zsh
@@ -60,6 +60,22 @@ function prompt_char {
echo '$'
}
+# virtualenv
+function ve_prompt_info {
+ if [[ $IN_VIRTUALENV == "true" ]]; then
+ echo "%{$fg[green]%}℘ %{$reset_color%}"
+ fi
+}
+
+# print the hostname in green if local, else red
+function hostname_info {
+ if [[ $ZSH_LOCAL_ENV == "true" ]]; then
+ echo "%{$fg[green]%}%m%{$reset_color%}"
+ else
+ echo "%{$fg[green]%}%{$bg[red]%}%m%{$reset_color%}"
+ fi
+}
+
# a colorful multiline prompt using the above defined functions
-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%} '
+PROMPT='%{$fg[yellow]%}%n%{$reset_color%}@$(hostname_info):%{$fg[blue]%}%~%{$reset_color%}
+$(return_code)$(ve_prompt_info)$(svn_prompt_info)$(git_prompt_info)$(prompt_char)%{$reset_color%} '