about summary refs log tree commit diff
path: root/.config/zsh
diff options
context:
space:
mode:
Diffstat (limited to '.config/zsh')
-rw-r--r--.config/zsh/.zshrc10
1 files changed, 8 insertions, 2 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index edab06a..8822bfc 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -95,16 +95,22 @@ function spacetotab () {
 
 # prompt
 # TODO maybe just use someone else's theme altogether
-# TODO git integration was useful - port something from belak/zsh-utils or ohmyzsh
 # TODO location should control its length a little better
 # TODO only color the last segment of the path (pwd)
+setopt prompt_subst
+autoload -Uz vcs_info
+zstyle ':vcs_info:*' actionformats '%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
+zstyle ':vcs_info:*' formats '%F{5}[%F{2}%b%F{5}]%f '
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
+precmd () { vcs_info }
+
 user="%n"
 if [[ -n "$SSH_CLIENT" || "$USER" == "root" ]]; then
 	user+="@%M"
 fi
 last_status="%(?.%F{green}%#.%F{red}%?)%f"
 location="%F{blue}%3~%f"
-PROMPT="[$user:$location] $last_status "
+PROMPT="[$user:$location] "'${vcs_info_msg_0_}'"${last_status} "
 unset user
 unset last_status
 unset location