Fix cd command if zoxide is missing (#2609)

* Fix cd command if zoxide is missing

* Make use of omarchy-cmd-present
This commit is contained in:
Wiehann
2025-10-27 09:55:38 +02:00
committed by GitHub
parent 75eb059779
commit 9b37d8549f

View File

@@ -4,8 +4,10 @@ alias lsa='ls -a'
alias lt='eza --tree --level=2 --long --icons --git' alias lt='eza --tree --level=2 --long --icons --git'
alias lta='lt -a' alias lta='lt -a'
alias ff="fzf --preview 'bat --style=numbers --color=always {}'" alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
alias cd="zd"
zd() { if omarchy-cmd-present z; then
alias cd="zd"
zd() {
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
builtin cd ~ && return builtin cd ~ && return
elif [ -d "$1" ]; then elif [ -d "$1" ]; then
@@ -13,7 +15,9 @@ zd() {
else else
z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found" z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found"
fi fi
} }
fi
open() { open() {
xdg-open "$@" >/dev/null 2>&1 & xdg-open "$@" >/dev/null 2>&1 &
} }