diff --git a/.zshrc b/.zshrc index 00089d8..1e27005 100644 --- a/.zshrc +++ b/.zshrc @@ -108,8 +108,21 @@ __shell_qol__() { fi if command_exists zoxide; then - eval "$(zoxide init zsh)" - eval "$(zoxide init zsh --cmd cd)" + + local raw="$(zoxide --version | awk '{print $2}')" + local ver="${raw#v}" # remove leading 'v' + local ver="${ver%%-*}" # remove anything after dash + + # local ver="$(zoxide --version | cut -d' ' -f2)" + if [[ "$ver" =~ ^0\.([0-5]|[0-9]{1,2})\. ]]; then + # older than 0.5.x + eval "$(zoxide init zsh)" + else + # newer than 0.5.x + eval "$(zoxide init zsh)" + eval "$(zoxide init zsh --cmd cd)" + fi + # ─< easier dir up >──────────────────────────────────────────────────────────────────────── alias ..="z .." else