X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/6a5f3187cb8cc0d7d3463ff97dddd415642c95b9..59aba6c965455891a22e8ea22f561854e43903bd:/.zsh/zshrc/82-load_alias-d?ds=sidebyside diff --git a/.zsh/zshrc/82-load_alias-d b/.zsh/zshrc/82-load_alias-d index 62e6e39..29880a9 100644 --- a/.zsh/zshrc/82-load_alias-d +++ b/.zsh/zshrc/82-load_alias-d @@ -12,9 +12,11 @@ function make_alias { setopt extendedglob local fn="${1:t}" s for l in ${(f)"$(<$1)"}; do + 0=$fn case "$s/$l" in (*/\#*) continue;; - (/*) eval "alias $fn='${l//\$0/$fn}'"; s=s; 0=$fn;; + (/\(\)*) eval "function $fn$l"; s=s;; + (/*) eval "alias $fn='${l//\$0/$fn}'"; s=s;; (s/(#b)(*)) eval "$match[1]";; esac done