mirror of https://github.com/akelge/zsh
remove zwc files, add gitfetch function
Also load modules for stat and time; Fix status typos
This commit is contained in:
parent
f89f77715c
commit
ca8a24d28e
|
@ -1,6 +1,14 @@
|
|||
#######################################################################################
|
||||
# Functions
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# Load usefule modules
|
||||
|
||||
zmodload -F zsh/stat b:zstat
|
||||
zmodload zsh/datetime
|
||||
#
|
||||
# Autoload all functions in zshfunctions
|
||||
#
|
||||
autoload -U $LIBRARY/zshfunctions/*(.:t)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,16 @@
|
|||
zmodload -F zsh/stat b:zstat
|
||||
zmodload zsh/datetime
|
||||
local _gitdir
|
||||
local last_fetch
|
||||
local diff
|
||||
|
||||
cd $1
|
||||
|
||||
_gitdir=$(git rev-parse --git-dir 2> /dev/null) || return 0
|
||||
last_fetch=$(zstat +mtime $_gitdir/FETCH_HEAD 2> /dev/null || echo 0)
|
||||
let "diff = $(strftime %s)- $last_fetch"
|
||||
[ $diff -gt ${GIT_FETCH_INTERVAL:-30} ] && git fetch --all -p
|
||||
|
||||
return 0
|
||||
|
||||
# vim: set ts=2 sw=2 tw=0 ft=sh :
|
|
@ -16,9 +16,9 @@ echo
|
|||
|
||||
if [ $HOMEBREW_PREFIX ]; then
|
||||
print -P "$FX[bold]Homebrew enabled: $FG[002]yes$FX[reset]"
|
||||
print -P "H$FX[bold]omebrew prefix: $FG[002]$HOMEBREW_PREFIX$FX[reset]"
|
||||
print -P "$FX[bold]Homebrew prefix: $FG[002]$HOMEBREW_PREFIX$FX[reset]"
|
||||
else
|
||||
print -P "H$FX[bold]omebrew enabled: $FG[001]no$FX[reset]"
|
||||
print -P "$FX[bold]Homebrew enabled: $FG[001]no$FX[reset]"
|
||||
fi
|
||||
|
||||
print -nP "\n$FX[bold]iTerm2 integration: "
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue