zshrc: help @Mkaysi to add exit status to prompt

This commit is contained in:
nyuszika7h 2013-02-09 16:46:22 +02:00 committed by Mika Suomalainen
parent 05b44c7cc5
commit 0716ec9731

15
zshrc
View File

@ -13,12 +13,21 @@ uname=`uname`
# This is based on zshrc which came with Debian (Third option in wizard for new users.) # This is based on zshrc which came with Debian (Third option in wizard for new users.)
# Set up the prompt # Set up the prompt
autoload -Uz promptinit 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 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 %~ PS1="%B%(!.%F{red}.%F{green})%n@%m %~
%#%f%b " %# %(?..%B%?%b )%f%b"
setopt histignorealldups sharehistory setopt histignorealldups sharehistory