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.
2 # Helper functions for temporary files, directories, and pastebining
4 # Copyright © 1994–2017 martin f. krafft <madduck@madduck.net>
5 # Released under the terms of the Artistic Licence 2.0
7 # Source repository: http://git.madduck.net/v/etc/zsh.git
12 REPLY=$(mktemp -td ${1:-cdt}.XXXXXX)
14 rm -f ${TMPDIR:-/tmp}/cdt.latest
15 ln -s $REPLY ${TMPDIR:-/tmp}/cdt.latest
31 -) local stdin=1; shift;;
32 *) if [ -z "${prefix:-}" ]; then
35 zwarn "prefix $prefix already specified, skipping: $i"
40 REPLY=$(mktemp -t ${prefix:-vit}-XXXXXX.txt)
41 [ -n "$stdin" ] && cat >| $REPLY
42 sensible-editor +start $REPLY </dev/tty >/dev/tty
43 ln -sf $REPLY ${TMPDIR:-/tmp}/vit.latest
55 local target="${(%):-"%D{%F-%H%M%S}"}-${1##*/}"
56 pub "${1}==${target}" 2>&1
61 if [[ -f "$REPLY" ]]; then
62 read -q "yesno?
\rShould I paste the file $REPLY? [yN] "
68 if [[ ${yesno:-n} == y ]]; then
69 zle -cR "pasting $REPLY …"
70 REPLY=$(pastebin "${REPLY}")
75 bindkey '\ep' _pastebinit
78 if [[ -n "$REPLY" ]]; then
79 if (( $+commands[xclip] )); then
80 echo -En "$REPLY" | xclip -in
81 zle -M "Copied to primary clipboard: $REPLY"
83 zle -M "Cannot copy to clipboard, xclip command not found"
86 zle -M "Nothing to copy, \$REPLY is empty"
90 bindkey '\ec' _copy_reply
96 REPLY="${TMPDIR:-/tmp}/script.${topic:-$LOGNAME}.$$.${(%):-"%D{%Y%m%d.%H%M}"}"
98 %# " RPS1= script -qe -c "zsh -f" -f "$REPLY"
100 zinfo "typescript is in $REPLY ."