summaryrefslogtreecommitdiff
path: root/config/essentials/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'config/essentials/zsh')
-rw-r--r--config/essentials/zsh/.zshrc11
1 files changed, 3 insertions, 8 deletions
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc
index 9b6fa48..2499c45 100644
--- a/config/essentials/zsh/.zshrc
+++ b/config/essentials/zsh/.zshrc
@@ -106,14 +106,9 @@ RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(par
setopt prompt_subst
parse_git_remote() {
- b="$(git branch -v 2>/dev/null | grep "^*" | cut -f2 -d'[' | cut -f1 -d' ')"
- if [ "$b" = "behind" ]
- then
- printf "↓ "
- elif [ "$b" = "ahead" ]
- then
- printf "↑ "
- fi
+ git branch -v 2>/dev/null |
+ grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' |
+ sed 's/ahead/↑/;s/behind/↓/;s/\*//'
}
parse_git_branch() {
git symbolic-ref --short HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null