zshrc: elite2 green for user, elite2 red for root

This commit is contained in:
Aminda Suomalainen 2018-10-11 12:56:34 +03:00
parent b4787fb7c0
commit b19551e8b4
No known key found for this signature in database
GPG Key ID: 0C207F07B2F32B67
1 changed files with 6 additions and 11 deletions

View File

@ -49,19 +49,14 @@ setopt SHARE_HISTORY
# Set up the prompt
autoload -Uz promptinit
# Green for normal user and red for root and show exit status
# if it's not 0. Thank you nyuszika7h
# Green for normal user and red for root
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 %~
%# %(?..%B%?%b )%f%b"
if [ $USER = "root" ]; then
prompt elite2 red
else
prompt elite2 green
fi
# Use emacs keybindings even if our EDITOR is set to vi
bindkey -e