From: martin f. krafft Date: Tue, 10 Jan 2012 16:33:09 +0000 (+0100) Subject: maintain latest symlink for tmpfuncs X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/a89e29c6ee8aec55e559f411431108c850533154?ds=inline maintain latest symlink for tmpfuncs --- 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