From: martin f. krafft Date: Fri, 23 Jun 2017 10:26:32 +0000 (+0200) Subject: Minor fixes to accomodate Zsh4 X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/57d22c7977ad80556aca28496d0192d4a72ef73a?ds=sidebyside Minor fixes to accomodate Zsh4 --- diff --git a/.zsh/themes/prompt_madduck_setup b/.zsh/themes/prompt_madduck_setup index 0b6dddc..69cff73 100644 --- a/.zsh/themes/prompt_madduck_setup +++ b/.zsh/themes/prompt_madduck_setup @@ -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} diff --git a/.zsh/util b/.zsh/util index ed37cb4..422dba9 100644 --- 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 } diff --git a/.zsh/zshrc/30-chmod+chown_aliases b/.zsh/zshrc/30-chmod+chown_aliases index 9d42db2..e5c0c43 100644 --- a/.zsh/zshrc/30-chmod+chown_aliases +++ b/.zsh/zshrc/30-chmod+chown_aliases @@ -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'" diff --git a/.zsh/zshrc/40-baseconv b/.zsh/zshrc/40-baseconv index b180e22..a64d423 100644 --- a/.zsh/zshrc/40-baseconv +++ b/.zsh/zshrc/40-baseconv @@ -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 diff --git a/.zsh/zshrc/80-completion b/.zsh/zshrc/80-completion index 4803d5c..15fc43b 100644 --- a/.zsh/zshrc/80-completion +++ b/.zsh/zshrc/80-completion @@ -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 diff --git a/.zsh/zshrc/99-getpw-override b/.zsh/zshrc/99-getpw-override index 1673631..4673014 100644 --- a/.zsh/zshrc/99-getpw-override +++ b/.zsh/zshrc/99-getpw-override @@ -1,4 +1,4 @@ -unalias getpw +unalias getpw 2>/dev/null getpw() { if ! pass -c "$@"; then if old-getpw "$@"; then diff --git a/.zsh/zshrc/99-prompt_setup b/.zsh/zshrc/99-prompt_setup index 2dcf49f..62101c9 100644 --- a/.zsh/zshrc/99-prompt_setup +++ b/.zsh/zshrc/99-prompt_setup @@ -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