From a82459c1d6edbfe148d9cadf235946da280c57f2 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 7 Oct 2021 16:59:33 -0700 Subject: [PATCH] zsh: made cds() mucho-fast-o --- .zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 6a3a46b..fdad16d 100644 --- a/.zshrc +++ b/.zshrc @@ -159,7 +159,12 @@ # cd search: cd to a directory, given part of its name cds() { - cd **/*"$1"* && pwd + if ! [ -z "$1" ];then + cd "$(fd --max-results=1 -t d "$1")" && pwd + else + echo "$0: no arguments provided" + return 1 + fi } # toggles whether a file or group of files is executable