zshrc: Add function cdt() to create a temporary directory and change current working...
[grml-etc-core.git] / etc / zsh / zshrc
index 3271ee8..3e20e5b 100644 (file)
@@ -2656,6 +2656,13 @@ fir() {
 mcd() {
     mkdir -p "$@" && cd "$@"
 }
+#f5# Create temporary directory and \kbd{cd} to it
+cdt() {
+    local t
+    t=$(mktemp -d)
+    echo "$t"
+    builtin cd "$t"
+}
 #f5# Unified diff to timestamped outputfile
 mdiff() {
     diff -udrP "$1" "$2" > diff.`date "+%Y-%m-%d"`."$1"