]>
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:
summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (parent:
e7b57bc )
function output() {
emulate -L zsh
local title="$@"
function output() {
emulate -L zsh
local title="$@"
- local output=(${(f)"$(cat)"})
+ local output; output =(${(f)"$(cat)"})
[[ ${#output} -ge 1 ]] || return
[[ ${#output} -ge 1 ]] || return
eval git diff $common_options "$@" 2>/dev/null
}
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}
local max=${#changed}
[[ $max -lt ${#cached} ]] && max=${#cached}
local arrayname="$1"; shift
local i
for i; do
local arrayname="$1"; shift
local i
for i; do
- eval "typeset -ga $arrayname=(\$i \${$arrayname[@]/\$i})"
+ eval "typeset -ga $arrayname; $arrayname =(\$i \${$arrayname[@]/\$i})"
local arrayname="$1"; shift
local i
for i; do
local arrayname="$1"; shift
local i
for i; do
- eval "typeset -ga $arrayname=(\${$arrayname[@]/\$i} \$i)"
+ eval "typeset -ga $arrayname; $arrayname =(\${$arrayname[@]/\$i} \$i)"
# Source repository: http://git.madduck.net/v/etc/zsh.git
#
# 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'"
local perm
for perm in $common_perms; do
eval alias $perm="'chmod $perm'"
-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
typeset -l {k,v}{1,2}
for k1 v1 in ${(kv)bases}; do
for k2 v2 in ${(kv)bases}; do
# a couple commands don't yet have -option completion but
# they're generic GNU tools, so…
# 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
local c
for c ($gnu_generic_tools) compdef _gnu_generic $c
+unalias getpw 2>/dev/null
getpw() {
if ! pass -c "$@"; then
if old-getpw "$@"; then
getpw() {
if ! pass -c "$@"; then
if old-getpw "$@"; then
#
autoload -Uz promptinit
#
autoload -Uz promptinit
-declare -la fpath_saved=($fpath)
+declare -la fpath_saved
+fpath_saved=($fpath)
fpath+=$ZDOTDIR/themes
promptinit
prompt madduck
fpath+=$ZDOTDIR/themes
promptinit
prompt madduck