AutoYADM commit: 2025-04-17 22:15:05
This commit is contained in:
parent
d532c7ee68
commit
77038e03e1
2 changed files with 14 additions and 11 deletions
13
.config/fish/custom_cd.fish
Normal file
13
.config/fish/custom_cd.fish
Normal file
|
@ -0,0 +1,13 @@
|
|||
if not functions -q __cd_orig
|
||||
functions --copy cd __cd_orig
|
||||
end
|
||||
|
||||
function cd --wraps=cd --description "Change directory. No args goes to git root or $HOME."
|
||||
git rev-parse --is-inside-work-tree &>/dev/null
|
||||
set -l is_git $status
|
||||
if test (count $argv) -ne 0; or not test $is_git -eq 0
|
||||
__cd_orig $argv
|
||||
else
|
||||
__cd_orig (git rev-parse --show-toplevel)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue