]> git.madduck.net Git - etc/zsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

convert aliases anonymous functions to proper functions
authormartin f. krafft <madduck@madduck.net>
Wed, 17 May 2017 13:16:38 +0000 (15:16 +0200)
committermartin f. krafft <madduck@madduck.net>
Wed, 17 May 2017 13:17:38 +0000 (15:17 +0200)
.zsh/aliases/rrsh [changed mode: 0644->0755]
.zsh/zshrc/82-load_alias-d

old mode 100644 (file)
new mode 100755 (executable)
index 8fb62d7..ea281ba
@@ -1 +1,2 @@
-() { ssh "$@" -t /bin/su }
+() { ssh "${@:-}" -t /bin/su }
+compdef ${0}=ssh
index 62e6e39f7df43e0063716bef271fc616148c1983..29880a9d4b7333fb2e730a28ec6a376a3aa7746f 100644 (file)
@@ -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