From 653765c70be76563b43fb1f60af86008ef3d1cad Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Apr 2025 14:30:05 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-18 14:30:05 --- .config/fish/conf.d/smartcd.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.config/fish/conf.d/smartcd.fish b/.config/fish/conf.d/smartcd.fish index fcb067c8..a3a7d44b 100644 --- a/.config/fish/conf.d/smartcd.fish +++ b/.config/fish/conf.d/smartcd.fish @@ -7,6 +7,11 @@ if not functions -q __cd_orig end function cd --wraps=cd --description "Change directory. No args goes to git root or $HOME. If already there, return to previous location." + # Skip history in subshells. + if status --is-command-substitution + builtin cd $argv + return $status + end git rev-parse --is-inside-work-tree &>/dev/null set -l is_git $status if test (count $argv) -ne 0 @@ -24,3 +29,9 @@ function cd --wraps=cd --description "Change directory. No args goes to git root end end end + +function smartcd_update --description "Update smartcd.fish with the latest from the upstream." + curl https://git.sr.ht/~ficd/smartcd.fish/blob/main/smartcd.fish \ + -o $fish_config/conf.d/smartcd.fish + exec fish +end