2018-06-15 13:43:04 +00:00
|
|
|
#!/usr/bin/env zsh
|
2018-02-23 09:38:24 +00:00
|
|
|
|
2019-04-22 15:07:02 +00:00
|
|
|
ZSH_DOTFILES="${0:h}"
|
2018-02-23 09:38:24 +00:00
|
|
|
|
2019-09-24 19:34:15 +00:00
|
|
|
autoload -U colors && colors
|
|
|
|
|
2019-10-25 17:50:15 +00:00
|
|
|
# Performance {{{
|
|
|
|
|
|
|
|
zmodload zsh/datetime
|
|
|
|
typeset -A _perf_timers
|
|
|
|
|
|
|
|
_perf_timer_start() {
|
|
|
|
local name="$1"
|
|
|
|
if [[ -z "$name" ]]; then
|
|
|
|
print >&2 "$0: usage: $0 <name>"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
_perf_timers[$name]="$EPOCHREALTIME"
|
|
|
|
}
|
|
|
|
|
|
|
|
_perf_timer_stop() {
|
|
|
|
local name="$1"
|
|
|
|
if [[ -z "$name" ]]; then
|
|
|
|
print >&2 "$0: usage: $0 <name>"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
local stop_time="$EPOCHREALTIME" start_time="${_perf_timers[$name]}"
|
|
|
|
local -i duration="$(( (stop_time - start_time) * 1000 ))"
|
2019-11-09 23:09:41 +00:00
|
|
|
print -- "$(print -P '%F{8}==>%f') ${name}: ${duration}ms"
|
2019-10-25 17:50:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
_perf_timer_start "total"
|
|
|
|
|
2019-09-24 19:34:15 +00:00
|
|
|
for script in functions options path env aliases plugins completion zle prompt colorscheme; do
|
2019-10-25 17:50:15 +00:00
|
|
|
_perf_timer_start "$script.zsh"
|
2019-04-22 15:07:02 +00:00
|
|
|
source "$ZSH_DOTFILES/$script.zsh"
|
2019-10-25 17:50:15 +00:00
|
|
|
_perf_timer_stop "$script.zsh"
|
2018-11-10 14:51:47 +00:00
|
|
|
done
|
|
|
|
|
2019-07-28 14:17:30 +00:00
|
|
|
# add colon after MANPATH so that it doesn't overwrite system MANPATH
|
|
|
|
MANPATH="$MANPATH:"
|
|
|
|
|
2019-05-05 23:24:22 +00:00
|
|
|
command_exists rbenv && eval "$(rbenv init -)"
|
|
|
|
|
2019-10-25 17:50:15 +00:00
|
|
|
_perf_timer_stop "total"
|
|
|
|
|
2019-03-08 18:10:30 +00:00
|
|
|
welcome
|