fix zshrc command checks

This commit is contained in:
fergus
2025-06-20 09:28:00 +01:00
parent cba38937fa
commit 0431ccfb96

View File

@ -25,6 +25,7 @@ unsetopt EXTENDED_HISTORY
# General options
setopt autocd extendedglob
unset command_not_found_handle
# fzf extra shell features
command -v fzf >/dev/null 2>&1 && source <(fzf --zsh)
@ -35,7 +36,7 @@ export FZF_TMUX="1"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "$\{(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
command -v fzf >/dev/null 2>& zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
command -v fzf >/dev/null 2>&1 && zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
autoload -U promptinit; promptinit
autoload -U compinit && compinit
@ -48,10 +49,10 @@ bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
# init prompt
command -v starship >/dev/null 2>& eval "$(starship init zsh)"
command -v starship >/dev/null 2>&1 && eval "$(starship init zsh)"
# run fastfetch on new shells
command -v fastfetch >/dev/null 2>& fastfetch
command -v fastfetch >/dev/null 2>&1 && fastfetch
# automatically enter a tmux session
tmux start-server
@ -68,7 +69,7 @@ if test -n "$KITTY_INSTALLATION_DIR"; then
fi
# add direnv hook if installed
command -v direnv >/dev/null 2>& eval "$(direnv hook zsh)"
command -v direnv >/dev/null 2>&1 && eval "$(direnv hook zsh)"
# export common env vars
export EDITOR="nvim"
@ -127,7 +128,7 @@ alias -- gs='git switch'
alias -- gst='git status'
# ls aliases
if [[ command -v eza >/dev/null 2>&1 ]]; then
if command -v eza >/dev/null 2>&1 ; then
alias -- ls='eza -lh -s=name --git --group-directories-first --no-permissions --icons --no-user'
alias -- lsa='eza -lha -s=name --git --group-directories-first --no-permissions --icons --no-user'
alias -- lsg='eza -lh -s=name --git --group-directories-first --git-ignore --no-permissions --icons --no-user'