From 0431ccfb968c48bc4e75499548f9d3a1d6f21356 Mon Sep 17 00:00:00 2001 From: fergus Date: Fri, 20 Jun 2025 09:28:00 +0100 Subject: [PATCH] fix zshrc command checks --- zsh/.zshrc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 21ac4bf..5bec62c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -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'