diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2021-06-26 14:58:26 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2021-06-26 14:58:26 +0100 |
| commit | d56519f98e29eb8a19b5686bb795f89139bac7c0 (patch) | |
| tree | 62eb57b462aa1b999af985b39dab4629a342cb99 /zsh | |
| parent | 26831afb5ae86c042d859d1b5c9e039dfe12a093 (diff) | |
zsh: Show current Git branch in ${RPROMPT}
This does not apply if ${TERM_PROGRAM} is ‘iTerm.app’ as iTerm2 already
has a status bar that shows that information.
See https://iterm2.com/documentation-status-bar.html for more details.
Diffstat (limited to 'zsh')
| -rw-r--r-- | zsh/rc | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -60,6 +60,18 @@ setopt HIST_REDUCE_BLANKS setopt INC_APPEND_HISTORY setopt SHARE_HISTORY +if [[ ${TERM_PROGRAM} != iTerm.app ]]; then + autoload -Uz vcs_info + + zstyle ':vcs_info:*' enable git + zstyle ':vcs_info:*' formats '[%b]' + + RPROMPT='${vcs_info_msg_0_}' + precmd_functions+=(vcs_info) + + setopt PROMPT_SUBST +fi + source_if_exists dotfiles-${UNAME}/zsh/rc source_if_exists dotfiles-${DOMAIN}/zsh/rc source_if_exists dotfiles-${HOST}/zsh/rc |
