X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/dffaced336ebd944972a3bd0be6a5ab21905eff4..a89e29c6ee8aec55e559f411431108c850533154:/.zsh/zshrc/39_tempfuncs diff --git a/.zsh/zshrc/39_tempfuncs b/.zsh/zshrc/39_tempfuncs index 0350925..79f43dd 100644 --- a/.zsh/zshrc/39_tempfuncs +++ b/.zsh/zshrc/39_tempfuncs @@ -9,8 +9,11 @@ # cdt () { - builtin cd $(mktemp -td ${1:-cdt}.XXXXXX) + local tmpdir + tmpdir=$(mktemp -td ${1:-cdt}.XXXXXX) + builtin cd $tmpdir pwd + ln -sf $tmpdir ${TMPDIR:-/tmp}/cdt.latest } vit () { @@ -27,10 +30,11 @@ vit () { ;; esac done - local tmpfile=$(mktemp -t ${prefix}.XXXXXX) + local tmpfile=$(mktemp -t ${prefix:-vit}.XXXXXX) [ -n "$stdin" ] && cat >| $tmpfile sensible-editor $tmpfile /dev/tty echo $tmpfile + ln -sf $tmpfile ${TMPDIR:-/tmp}/vit.latest } # vim:ft=zsh