From 5f7bd5142ccf56d558f1056260bc26f827589570 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 28 May 2023 16:41:39 -0700 Subject: [PATCH] add cdt function --- .config/shell/functions/cdt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .config/shell/functions/cdt diff --git a/.config/shell/functions/cdt b/.config/shell/functions/cdt new file mode 100644 index 0000000..b06dbfd --- /dev/null +++ b/.config/shell/functions/cdt @@ -0,0 +1,8 @@ +#!/bin/sh +# This will "cd to" the directory a file is in +# Usage: +# cdt + +cdt() { + cd "$(dirname "$(realpath "$1")")" +}