From c1a7e3e37eca9c543e57f2ae6ac5d848a5b4af72 Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Thu, 17 Jul 2025 21:24:15 +0530 Subject: Improved prompt theme and fixed lua_ls config --- .zshrc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to '.zshrc') diff --git a/.zshrc b/.zshrc index c618c09..a91e19e 100644 --- a/.zshrc +++ b/.zshrc @@ -56,4 +56,33 @@ alias help=run-help autoload -Uz e v p bell +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:*' get-revision true +zstyle ':vcs_info:*' formats "(%s)-[%b]%m%u%c" +zstyle ':vcs_info:*' actionformats "(%s)-[%b]%m%u%c" + +zstyle ':vcs_info:git*+set-message:*' hooks git-untracked + ++vi-git-untracked() { + if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \ + git status --porcelain | grep -m 1 '^??' &>/dev/null + then + hook_com[misc]='T' + fi +} + +zstyle ':vcs_info:git*+set-message:*' hooks git-st + +function +vi-git-st() { + local ahead behind + local -a gitstatus + + ahead=$(git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l) + (( $ahead )) && gitstatus+=( "+${ahead}" ) + + behind=$(git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l) + (( $behind )) && gitstatus+=( "-${behind}" ) + + hook_com[misc]+=${(j:/:)gitstatus} +} -- cgit v1.2.3-70-g09d2