zsh: fix command lookup using $+array[] syntax

master
bretello 2024-04-22 09:47:24 +02:00
parent 26022ea7b6
commit c572b2cb10
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
1 changed files with 6 additions and 6 deletions

View File

@ -39,12 +39,12 @@ if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
antidote bundle <${zsh_plugins}.txt >>${zsh_plugins}.zsh
if [[ $+commands[systemctl] ]]; then
if (( $+commands[systemctl] )); then
antidote bundle robbyrussell/oh-my-zsh path:plugins/systemd >>${zsh_plugins}.zsh
fi
if [[ $+commands[pacman] ]]; then
if (( $+commands[pacman] )); then
antidote bundle robbyrussell/oh-my-zsh path:plugins/archlinux >>${zsh_plugins}.zsh
elif [[ $+commands[apt-get] ]]; then
elif (( $+commands[apt-get] )); then
antidote bundle robbyrussell/oh-my-zsh path:plugins/debian >>${zsh_plugins}.zsh
fi
@ -60,7 +60,7 @@ source $DOTFILES/extras/completion_style.zsh
source $DOTFILES/extras/colors.zsh
source $DOTFILES/extras/fzf-tab-config.zsh
if [[ $+commands[fd] ]]; then
if (( $+commands[fd] )); then
export FZF_CTRL_T_COMMAND='fd'
else
export FZF_CTRL_T_COMMAND='find'
@ -112,8 +112,8 @@ export ZSH_AUTOSUGGEST_COMPLETION_IGNORE='* \#*' # prevent completion for commen
# less options
export LESS='-xRF-j12' # -j12: displays 12 lines before search results with / and ?
if [[ $+commands[bat] || $+commands[batcat] ]]; then
if [[ $+commands[bat] ]]; then cmd=bat else cmd=batcat fi
if (( $+commands[bat] || $+commands[batcat] )); then
if (( $+commands[bat] )); then cmd=bat else cmd=batcat fi
alias cat=$cmd
export PAGER=$cmd