[zsh] Reimplement loading of custom scripts.

This commit is contained in:
Keanu Timmermans 2021-05-10 20:38:37 +02:00
parent be27b811f7
commit 091449f604
Signed by: keanucode
GPG Key ID: A7431C0D513CA93B
2 changed files with 11 additions and 5 deletions

View File

@ -6,6 +6,10 @@ bytecount() { wc -c "$@" | numfmt --to=iec-i; }
mkcd() { mkdir -p "$@" && cd "${@[-1]}"; }
# Re-added from:
# https://github.com/dmitmel/dotfiles/blob/16f0a1cf32ec97355da2e17de1c4bb458431767b/zsh/functions.zsh#L19
source_if_exists() { [[ -f "$1" ]] && source "$1" }
silence() { $1 &>/dev/null }
viscd() {

View File

@ -52,11 +52,13 @@ for script in functions options path env plugins aliases completion zle prompt c
_perf_timer_stop "$script.zsh"
done
for script in $ZSH_DOTFILES/custom/**; do
_perf_timer_start "$script"
source "$script"
_perf_timer_stop "$script"
done
if [[ -d "$ZSH_DOTFILES/custom" ]]; then
for script in $ZSH_DOTFILES/custom/*.zsh; do
_perf_timer_start "custom/${script##*/}"
source "$script"
_perf_timer_stop "custom/${script##*/}"
done
fi
command_exists rbenv && eval "$(rbenv init -)"