From 32afa7668c575e962af9dac2bd3586a1db4f5491 Mon Sep 17 00:00:00 2001 From: Amand Tihon Date: Mon, 2 May 2011 11:55:58 +0200 Subject: [PATCH] Slight change to git prompt --- S60_git | 14 ++++++++++---- S90_prompt | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/S60_git b/S60_git index bb2c6f0..2972c39 100644 --- a/S60_git +++ b/S60_git @@ -27,25 +27,31 @@ git_preexec() { __ZSH_GIT_STATUS_INVALID=1 } - git_get_status() { # Return only git status local gitstat gitstatus gitstat=$(git status 2> /dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)') + # 'fix for mcedit parser gitstatus="" if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then - gitstatus='+' + gitstatus='✚' fi if [[ $(echo ${gitstat} | grep -c "^\# Changed but not updated:$") > 0 || \ $(echo ${gitstat} | grep -c "^\# Changes not staged for commit:$") > 0 ]]; then - gitstatus="${gitstatus}!" + gitstatus="${gitstatus}✹" fi if [[ $(echo ${gitstat} | grep -c "^# Untracked files:$") > 0 ]]; then - gitstatus="${gitstatus}?" + gitstatus="${gitstatus}★" + fi + + if [[ -z $gitstatus ]]; then + gitstatus="%{${fg_bold[green]}%}✔%{$reset_color%}" + else + gitstatus="%{${fg_bold[yellow]}%}$gitstatus%{$reset_color%}" fi echo $gitstatus diff --git a/S90_prompt b/S90_prompt index e95bc9e..10832a2 100644 --- a/S90_prompt +++ b/S90_prompt @@ -8,6 +8,7 @@ C_BYELLOW="%{${fg_bold[yellow]}%}" C_BRED="%{${fg_bold[red]}%}" C_BCYAN="%{${fg_bold[cyan]}%}" C_GREEN="%{${fg[green]}%}" +C_BGREEN="%{${fg_bold[green]}%}" C_MAGENTA="%{${fg_bold[magenta]}%}" @@ -22,8 +23,9 @@ _hour="${C_BCYAN}[%D{%H:%M}]${C_NO}" _exitcode="%(?::${C_BRED}[ %1v ]${C_NO} )$(true)" + _action="%(5v,%5v%,)" -_path='${C_GREEN}%(7v,%20<..<%7v%<<${C_NO}${C_MAGENTA}@%6v%5v${C_BYELLOW}%9v${C_NO}${C_GREEN}/%15<..<%8v%<<,%25<..<%~%<<)${C_NO}' +_path='${C_GREEN}%(7v,%20<..<%7v%<<${C_NO}${C_MAGENTA}@%6v%5v${__ZSH_GIT_STATUS}${C_GREEN}/%15<..<%8v%<<,%25<..<%~%<<)${C_NO}' _batt='%{${fg_bold[$psvar[3]]}%}%2v%{$reset_color%} ' -- 2.39.2