diff options
| author | 2020-02-28 22:41:05 -0500 | |
|---|---|---|
| committer | 2020-02-28 22:41:05 -0500 | |
| commit | 0d78ceb1fa0c7e438c299acf82dd70530fc41729 (patch) | |
| tree | 56e56f376757111ff6ccc09d9c4cb17917b2701e | |
| parent | Squashed 'dot_local/share/toasty/' content from commit aee4da7 (diff) | |
Squashed 'dot_local/share/toasty/' changes from aee4da7..8626c5c
8626c5c add support for executable functions
111dba5 modernize zshrc: remove needless quotes
git-subtree-dir: dot_local/share/toasty
git-subtree-split: 8626c5c2c677c26acf09ecfddd9d1c262ba1ef37
| -rw-r--r-- | zshrc | 41 |
1 files changed, 23 insertions, 18 deletions
@@ -1,8 +1,8 @@ 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}" +zrc=$zrc:A # resolve $zrc (assume path) to its absolute location +zshd=${zrc:h} -: "${zd:=$HOME/.zsh}" +: ${zd:=$HOME/.zsh} # spath -> autosource path, ala plugins # apath -> sourceall path, for .d dirs @@ -11,35 +11,40 @@ typeset -T APATH apath # default values spath=( - "$zd/plugins" - "$zshd/plugins" + $zd/plugins + $zshd/plugins ) apath=( - "$zshd/source" - "$zd/source" + $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" + $zd/functions + $zd/completions + $zd/prompts + $zshd/functions + $zshd/completions + $zshd/prompts +) +# you can use your functions as standalone scripts without autoloading them +# just +x +path+=( + $zd/functions ) # sourced before sourcealling # should be the location to edit fpath/apath/spath -[[ -f "$zd/pre" ]] && . "$zd/pre" +[[ -f $zd/pre ]] && . $zd/pre # allow digest drop-in -if [[ -d "$zd/digests" ]]; then +if [[ -d $zd/digests ]]; then local f= for f in $zd/digests/*.zwc(N); do - fpath+=( "$f" ) - autoload -w "$f" + fpath+=( $f ) + autoload -w $f done fi @@ -47,7 +52,7 @@ autoload sourceall sourceall zsh # source every .zsh file in every $apath[@] directory # local zshrc -[[ -f "$zd/zshrc.local" ]] && . "$zd/zshrc.local" +[[ -f $zd/zshrc.local ]] && . $zd/zshrc.local # LITERALLY THE VERY LAST THING WE DO IS COMPINIT PLS DUN DO IT URSELF autoload -Uz compinit |
