setopt prompt_subst autoload -Uz vcs_info # display the name of the branch zstyle ':vcs_info:git*' formats "[%b]" zstyle ':vcs_info:*' enable git precmd () { vcs_info } PROMPT="%K{cyan}%F{black}%n@%m%k%F{yellow}%~%f %F{green}${vcs_info_msg_0_}%f%% " # For tramp (emacs). if [ "$TERM" = "dumb" ]; then unset PROMPT PS1='$ ' unsetopt zle fi