]> 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:

Minor fixes to accomodate Zsh4
authormartin f. krafft <madduck@madduck.net>
Fri, 23 Jun 2017 10:26:32 +0000 (12:26 +0200)
committermartin f. krafft <madduck@madduck.net>
Fri, 23 Jun 2017 14:44:55 +0000 (16:44 +0200)
.zsh/themes/prompt_madduck_setup
.zsh/util
.zsh/zshrc/30-chmod+chown_aliases
.zsh/zshrc/40-baseconv
.zsh/zshrc/80-completion
.zsh/zshrc/99-getpw-override
.zsh/zshrc/99-prompt_setup

index 0b6dddcbdadcc073c2d000639617056c6b86ee6b..69cff7331402b9c34e0be89460ae3c58426841ad 100644 (file)
@@ -59,7 +59,7 @@ __git_print_preprompt()
   function output() {
     emulate -L zsh
     local title="$@"
-    local output=(${(f)"$(cat)"})
+    local output; output=(${(f)"$(cat)"})
 
     [[ ${#output} -ge 1 ]] || return
 
@@ -81,8 +81,8 @@ __git_print_preprompt()
     eval git diff $common_options "$@" 2>/dev/null
   }
 
-  local cached=(${(f)"$(gitdiffstat --cached | output cached)"})
-  local changed=(${(f)"$(gitdiffstat | output changed)"})
+  local cached; cached=(${(f)"$(gitdiffstat --cached | output cached)"})
+  local changed; changed=(${(f)"$(gitdiffstat | output changed)"})
 
   local max=${#changed}
   [[ $max -lt ${#cached} ]] && max=${#cached}
index ed37cb49e9a107bd169f3c2f95c479c8c1f61c41..422dba954987362ffc25837f6cdd024e62e6752a 100644 (file)
--- a/.zsh/util
+++ b/.zsh/util
@@ -16,7 +16,7 @@ array_prepend() {
   local arrayname="$1"; shift
   local i
   for i; do
-    eval "typeset -ga $arrayname=(\$i \${$arrayname[@]/\$i})"
+    eval "typeset -ga $arrayname; $arrayname=(\$i \${$arrayname[@]/\$i})"
   done
 }
 
@@ -24,7 +24,7 @@ array_append() {
   local arrayname="$1"; shift
   local i
   for i; do
-    eval "typeset -ga $arrayname=(\${$arrayname[@]/\$i} \$i)"
+    eval "typeset -ga $arrayname; $arrayname=(\${$arrayname[@]/\$i} \$i)"
   done
 }
 
index 9d42db24c0c8387ca8310a8d6f5b83462238f850..e5c0c43f99c572fc9fd8b4124271e3900ed49484 100644 (file)
@@ -7,7 +7,8 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-typeset -la common_perms=(rw- rwx r-- r-x r-s rws)
+typeset -la common_perms
+common_perms=(rw- rwx r-- r-x r-s rws)
 local perm
 for perm in $common_perms; do
   eval alias $perm="'chmod $perm'"
index b180e22e20680b51c904c2ccafe3f1a1f72f797d..a64d4237541fd24fd5bab3de5d311c5bbcb1be2d 100644 (file)
@@ -18,7 +18,8 @@ function baseconv() {
   echo ${var#*\#}
 }
 
-typeset -lA bases=(b 2 o 8 d 10 h 16)
+typeset -lA bases
+bases=(b 2 o 8 d 10 h 16)
 typeset -l {k,v}{1,2}
 for k1 v1 in ${(kv)bases}; do
   for k2 v2 in ${(kv)bases}; do
index 4803d5cb184d1b02124f9e1134e3c17312510433..15fc43b7a864b96d9e2aae30a82fedeeb41c7ab3 100644 (file)
@@ -188,7 +188,8 @@ compdef _precommand strace
 
 # a couple commands don't yet have -option completion but
 # they're generic GNU tools, so…
-typeset -la gnu_generic_tools=(mv)
+typeset -la gnu_generic_tools
+gnu_generic_tools=(mv)
 local c
 for c ($gnu_generic_tools) compdef _gnu_generic $c
 
index 1673631b774f87a233838f57a9a647a09e147301..4673014730173d972fd5f435216daef44a7af5fc 100644 (file)
@@ -1,4 +1,4 @@
-unalias getpw
+unalias getpw 2>/dev/null
 getpw() {
   if ! pass -c "$@"; then
     if old-getpw "$@"; then
index 2dcf49f45bdfa70ec116a3fd00ab31aad5095fe7..62101c9d8a8480286a1ac6fc308e7e9748a0166b 100644 (file)
@@ -8,7 +8,8 @@
 #
 
 autoload -Uz promptinit
-declare -la fpath_saved=($fpath)
+declare -la fpath_saved
+fpath_saved=($fpath)
 fpath+=$ZDOTDIR/themes
 promptinit
 prompt madduck