From 0716ec97313084456306712744f619d9d06c45c9 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Sat, 9 Feb 2013 16:46:22 +0200 Subject: [PATCH] zshrc: help @Mkaysi to add exit status to prompt --- zshrc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/zshrc b/zshrc index 81b03a8e..fc770a1f 100644 --- a/zshrc +++ b/zshrc @@ -13,12 +13,21 @@ uname=`uname` # This is based on zshrc which came with Debian (Third option in wizard for new users.) # Set up the prompt - autoload -Uz promptinit -# Green for normal user and red for root. Thank you nyuszika7h + +# Green for normal user and red for root and show exit status +# if it's not 0. Thank you nyuszika7h promptinit +autoload -Uz vcs_info +autoload -Uz colors && colors +setopt PROMPT_SUBST +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' enable git svn bzr hg +zstyle ':vcs_info:*' formats '%b ' +precmd() { vcs_info } + PS1="%B%(!.%F{red}.%F{green})%n@%m %~ -%#%f%b " +%# %(?..%B%?%b )%f%b" setopt histignorealldups sharehistory