aboutsummaryrefslogtreecommitdiff
path: root/base/zsh/k.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'base/zsh/k.zsh')
-rw-r--r--base/zsh/k.zsh4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/zsh/k.zsh b/base/zsh/k.zsh
index 6e2e2bd..e61cbdf 100644
--- a/base/zsh/k.zsh
+++ b/base/zsh/k.zsh
@@ -209,6 +209,7 @@ k () {
# only set once per directory so must be out of the main loop
typeset -i IS_GIT_REPO=0
typeset GIT_TOPLEVEL
+ typeset GIT_TOPBRANCH
#typeset -i LARGE_FILE_COLOR=196
typeset -i LARGE_FILE_COLOR=1
@@ -274,6 +275,7 @@ k () {
if $(git rev-parse --is-inside-work-tree 2> /dev/null); then
INSIDE_WORK_TREE=1
GIT_TOPLEVEL=$(git rev-parse --show-toplevel)
+ GIT_TOPBRANCH="[$(git rev-parse --abbrev-ref HEAD 2>/dev/null)]"
fi
# Break total blocks of the front of the stat call, then push the rest to results
@@ -350,7 +352,7 @@ k () {
done
# Print total block before listing
- echo "total $TOTAL_BLOCKS"
+ echo "total $TOTAL_BLOCKS "$'\e['"$K_COLOR_BR"'m'"$GIT_TOPBRANCH"$'\e[0m'
# ----------------------------------------------------------------------------
# Loop through each line of stat, pad where appropriate and do git dirty checking