X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/6a5f3187cb8cc0d7d3463ff97dddd415642c95b9..e54f33f71ea6d96b1e2eafa445af4dd0fa9fe10a:/.zsh/zshrc/82-load_alias-d?ds=inline 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