diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-05-08 20:40:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 20:40:36 +0200 |
commit | 0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534 (patch) | |
tree | 946d9f8b758ebdd63da96152ca56b154c99068da /themes/avit.zsh-theme | |
parent | afb028763cf40fc339e49011b2cba124dc108fcb (diff) | |
parent | ebc700be9b2fa7ae770a644093a5c46a8e323726 (diff) | |
download | zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.gz zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.tar.bz2 zsh-0232ac4bb1cb64b5bfaa7e5fc979d6f7ab23e534.zip |
Merge branch 'master' into master
Diffstat (limited to 'themes/avit.zsh-theme')
-rw-r--r-- | themes/avit.zsh-theme | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme index 4f0dcbcc6..aec14e4a6 100644 --- a/themes/avit.zsh-theme +++ b/themes/avit.zsh-theme @@ -50,9 +50,7 @@ function _ruby_version() { # use a neutral color, otherwise colors will vary according to time. function _git_time_since_commit() { # Only proceed if there is actually a commit. - if git log -1 > /dev/null 2>&1; then - # Get the last commit. - last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null) + if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then now=$(date +%s) seconds_since_last_commit=$((now-last_commit)) @@ -65,7 +63,7 @@ function _git_time_since_commit() { sub_hours=$((hours % 24)) sub_minutes=$((minutes % 60)) - if [ $hours -gt 24 ]; then + if [ $hours -ge 24 ]; then commit_age="${days}d" elif [ $minutes -gt 60 ]; then commit_age="${sub_hours}h${sub_minutes}m" @@ -104,7 +102,7 @@ ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}" ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}" -# LS colors, made with http://geoff.greer.fm/lscolors/ +# LS colors, made with https://geoff.greer.fm/lscolors/ export LSCOLORS="exfxcxdxbxegedabagacad" export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:' export GREP_COLOR='1;33' |