AutoYADM commit: 2025-04-16 19:40:12
This commit is contained in:
parent
26a6eb47d5
commit
408e1aa8b0
3 changed files with 13 additions and 15 deletions
|
@ -1,4 +1,17 @@
|
||||||
if status is-interactive
|
if status is-interactive
|
||||||
|
|
||||||
|
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."
|
||||||
|
if test (count $argv) -ne 0; or not git rev-parse --is-inside-work-tree &>/dev/null
|
||||||
|
__cd_orig $argv
|
||||||
|
else
|
||||||
|
__cd_orig (git rev-parse --show-toplevel)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
starship init fish | source
|
starship init fish | source
|
||||||
direnv hook fish | source
|
direnv hook fish | source
|
||||||
zoxide init fish | source
|
zoxide init fish | source
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
# 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."
|
|
||||||
if test (count $argv) -ne 0; or not git rev-parse --is-inside-work-tree &>/dev/null
|
|
||||||
__cd_orig $argv
|
|
||||||
else
|
|
||||||
__cd_orig (git rev-parse --show-toplevel)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,3 +0,0 @@
|
||||||
function gcd --description 'cd to the root of current git repo'
|
|
||||||
cd (git rev-parse --show-toplevel)
|
|
||||||
end
|
|
Loading…
Add table
Add a link
Reference in a new issue