From d93a6701cfad7a099ae8e33f9833a11aaf11c678 Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Tue, 15 Mar 2011 16:14:58 -0400 Subject: make non-local hosts obvious and show a special character for python virtualenv --- zsh/appearance.zsh | 20 ++++++++++++++++++-- 1 file 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%} ' -- cgit v1.2.3