summaryrefslogtreecommitdiff
path: root/dot_local/share/toasty/zshrc
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2020-02-14 19:11:04 -0500
committerChloe Kudryavtsev <toast@toast.cafe>2020-02-14 19:11:04 -0500
commit0d9a5a245a7be7e444d7f34e959dd06cb7b053e0 (patch)
tree3d42142e6ee22dbb72683e0b3549216f17bb6629 /dot_local/share/toasty/zshrc
parentzsh: remove toasty (preparation for git subtree) (diff)
parentSquashed 'dot_local/share/toasty/' content from commit aee4da7 (diff)
Merge commit '858a4a31a251d0eab21dffb96776aca007dafb07' as 'dot_local/share/toasty'
Diffstat (limited to 'dot_local/share/toasty/zshrc')
-rw-r--r--dot_local/share/toasty/zshrc56
1 files changed, 56 insertions, 0 deletions
diff --git a/dot_local/share/toasty/zshrc b/dot_local/share/toasty/zshrc
new file mode 100644
index 0000000..33fcbb6
--- /dev/null
+++ b/dot_local/share/toasty/zshrc
@@ -0,0 +1,56 @@
+print -Pv zrc %N # get current file location, store it in $zrc
+zrc="$zrc:A" # resolve $zrc (assume path) to its absolute location
+zshd="${zrc:h}"
+
+: "${zd:=$HOME/.zsh}"
+
+# spath -> autosource path, ala plugins
+# apath -> sourceall path, for .d dirs
+typeset -T SPATH spath
+typeset -T APATH apath
+
+# default values
+spath=(
+ "$zd/plugins"
+ "$zshd/plugins"
+)
+apath=(
+ "$zshd/source"
+ "$zd/source"
+)
+
+# user stuff comes first
+# completions come after the functions they complete
+fpath+=(
+ "$zd/functions"
+ "$zd/completions"
+ "$zd/prompts"
+ "$zshd/functions"
+ "$zshd/completions"
+ "$zshd/prompts"
+)
+
+# sourced before sourcealling
+# should be the location to edit fpath/apath/spath
+[[ -f "$zd/pre" ]] && . "$zd/pre"
+
+# allow digest drop-in
+if [[ -d "$zd/digests" ]]; then
+ local f=
+ for f in $zd/digests/*.zwc(N); do
+ fpath+=( "$f" )
+ autoload -w "$f"
+ done
+fi
+
+autoload sourceall
+sourceall zsh # source every .zsh file in every $apath[@] directory
+
+# local zshrc
+[[ -f "$zd/zshrc.local" ]] && . "$zd/zshrc.local"
+
+# LITERALLY THE VERY LAST THING WE DO IS COMPINIT PLS DUN DO IT URSELF
+autoload -Uz compinit
+compinit
+
+# vim: ft=zsh