AutoYADM commit: 2025-04-16 19:35:12
This commit is contained in:
parent
ba256e3495
commit
26a6eb47d5
1 changed files with 7 additions and 6 deletions
|
@ -1,11 +1,12 @@
|
|||
# Defined via `source`
|
||||
# One-time setup, preserve original cd definition
|
||||
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."
|
||||
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
|
||||
__cd_orig $argv
|
||||
else
|
||||
source $cdfunc
|
||||
cd (git rev-parse --show-toplevel)
|
||||
__cd_orig (git rev-parse --show-toplevel)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue