# zshrc/40_tempfuncs # # Helper functions to create temporary files and directories # # Copyright © 1994–2008 martin f. krafft # Released under the terms of the Artistic Licence 2.0 # # Source repository: git://git.madduck.net/etc/zsh.git # cdt () { builtin cd $(mktemp -td cdt.XXXXXXXX) pwd } vit () { local tmpfile=$(mktemp -t vit.XXXXXXXX) [ "$1" = '-' ] && cat >| $tmpfile sensible-editor $tmpfile /dev/tty echo $tmpfile } # vim:ft=zsh