shell/plugins: fix zoxide check issue
This commit is contained in:
parent
f034209385
commit
b7d187caaa
1 changed files with 3 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
# shell plugins for POSIX
|
# shell plugins for POSIX
|
||||||
|
|
||||||
# Enable zoxide if it exists
|
# Enable zoxide if it exists
|
||||||
if command zoxide > /dev/null 2>&1 || ${SKIP_ZOXIDE:-false}; then
|
if command -v zoxide > /dev/null 2>&1 || ${SKIP_ZOXIDE:-false}; then
|
||||||
# Check what shell we're using based on variables that get set by non-posix shells - https://stackoverflow.com/a/3327022
|
# Check what shell we're using based on variables that get set by non-posix shells - https://stackoverflow.com/a/3327022
|
||||||
if [ -n "${ZSH_NAME+set}" ]; then # zsh
|
if [ -n "${ZSH_NAME+set}" ]; then # zsh
|
||||||
eval "$(zoxide init zsh)"
|
eval "$(zoxide init zsh)"
|
||||||
|
@ -12,4 +12,6 @@ if command zoxide > /dev/null 2>&1 || ${SKIP_ZOXIDE:-false}; then
|
||||||
# assume posix
|
# assume posix
|
||||||
eval "$(zoxide init posix --hook prompt)"
|
eval "$(zoxide init posix --hook prompt)"
|
||||||
fi
|
fi
|
||||||
|
# make an alias (feels wrong to do it here, but feels worse to split it into ./aliases)
|
||||||
|
alias z=zoxide
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue