about summary refs log tree commit diff
path: root/.config/zsh/prompt.zsh
diff options
context:
space:
mode:
Diffstat (limited to '.config/zsh/prompt.zsh')
-rw-r--r--.config/zsh/prompt.zsh5
1 files changed, 4 insertions, 1 deletions
diff --git a/.config/zsh/prompt.zsh b/.config/zsh/prompt.zsh
index 81e3664..6ae208e 100644
--- a/.config/zsh/prompt.zsh
+++ b/.config/zsh/prompt.zsh
@@ -8,9 +8,12 @@ autoload -Uz vcs_info
 zstyle ':vcs_info:*' enable git
 zstyle ':vcs_info:*' actionformats '%F{purple}[%F{green}%b%F{olive}|%F{red}%a%F{purple}]%f '
 zstyle ':vcs_info:*' formats '%F{purple}[%F{green}%b%F{purple}]%f '
-precmd () { 
+
+get_git () {
 	[[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]] && vcs_info || vcs_info_msg_0_=""
 }
+autoload -Uz add-zsh-hook
+add-zsh-hook precmd get_git
 
 user="%n"
 if [[ -n "$SSH_CLIENT" || "$USER" == "root" ]]; then