autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*:prompt:*' formats "$VCSPROMPT" "[%b]"
precmd() {
vcs_info 'prompt'
if [ -n vcs_info_msg_0_ ]; then
RPROMPT="${vcs_info_msg_1_}"
else
RPROMPT=""
fi
}
PROMPT=$'%F{green}%~#%f '
The result is that the current working directory is shown on the left side and the name of the branch in braces on the right. I could probably configure it in a way which shows me a lot more information but all I want is a little reminder about the branch I'm currently in.
Keine Kommentare:
Kommentar veröffentlichen