refactor: group relevant sections in zshrc

master
George Rawlinson 2021-07-08 16:51:12 +00:00
parent 29a2860649
commit 9061406734
Signed by: grawlinson
GPG Key ID: E0959FEA8B550539
1 changed files with 18 additions and 22 deletions

40
zshrc
View File

@ -1,27 +1,11 @@
# setup umask [0755] # setup umask [0755]
umask 0022 umask 0022
# spath -> plugins; apath -> drop-in path # ensure there are no duplicates in $PATH
typeset -T SPATH spath typeset -U PATH path
typeset -T APATH apath
typeset -U PATH path # discard duplicates
# example: append to path, then make available to child processes # user files sourced before system files
# path+=('$VAR'); export PATH # completions sourced after the functions they complete
# default path values
spath=(
"$ZDOTDIR/plugins"
"$ZSYSDIR/plugins"
)
apath=(
"$ZDOTDIR/source"
"$ZSYSDIR/source"
)
# user stuff comes first
# completions come after the functions they complete
fpath+=( fpath+=(
"$ZDOTDIR/functions" "$ZDOTDIR/functions"
"$ZDOTDIR/completions" "$ZDOTDIR/completions"
@ -31,11 +15,23 @@ fpath+=(
"$ZSYSDIR/prompts" "$ZSYSDIR/prompts"
) )
# source every zsh file in every APATH directory # drop-in directory (like /etc/zsh.d)
# sourceall iterates over APATH, sourcing every file it finds
typeset -T APATH apath
apath=(
"$ZDOTDIR/source"
"$ZSYSDIR/source"
)
autoload sourceall autoload sourceall
sourceall zsh sourceall zsh
# plugins # plugins (explicitly loaded)
# autosource iterates over SPATH until a matching plugin is found and sourced
typeset -T SPATH spath
spath=(
"$ZDOTDIR/plugins"
"$ZSYSDIR/plugins"
)
autoload autosource autoload autosource
autosource coloured-man autosource coloured-man
autosource sudo autosource sudo