From ba256e34952907232527f10a134c7b446d1087cf Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Wed, 16 Apr 2025 19:30:12 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-16 19:30:12 --- .config/fish/functions/cd.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .config/fish/functions/cd.fish diff --git a/.config/fish/functions/cd.fish b/.config/fish/functions/cd.fish new file mode 100644 index 00000000..e1b9dd0c --- /dev/null +++ b/.config/fish/functions/cd.fish @@ -0,0 +1,11 @@ +# Defined via `source` +function cd --wraps=cd --description "Change directory. No args goes to git root or $HOME." + set -l cdfunc /usr/share/fish/functions/cd.fish + if test (count $argv) -ne 0; or not git rev-parse --is-inside-work-tree &>/dev/null + source $cdfunc + cd $argv + else + source $cdfunc + cd (git rev-parse --show-toplevel) + end +end