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
|
@ -1,16 +1,6 @@
|
|||
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
|
||||
source ~/.config/fish/custom_cd.fish
|
||||
|
||||
starship init fish | source
|
||||
direnv hook fish | source
|
||||
|
|
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