X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/6a3fd78bbaeda0aa6761a03dbf21217d441a812f..a89e29c6ee8aec55e559f411431108c850533154:/.zsh/zshrc/39_tempfuncs?ds=sidebyside diff --git a/.zsh/zshrc/39_tempfuncs b/.zsh/zshrc/39_tempfuncs index 4b46a17..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 () { @@ -31,6 +34,7 @@ vit () { [ -n "$stdin" ] && cat >| $tmpfile sensible-editor $tmpfile /dev/tty echo $tmpfile + ln -sf $tmpfile ${TMPDIR:-/tmp}/vit.latest } # vim:ft=zsh