From ffaafb4533114cf7ace2f1da86519ede614abaec Mon Sep 17 00:00:00 2001 From: Caleb Braaten Date: Wed, 3 Jul 2024 15:22:42 -0700 Subject: [PATCH] Add conditional logic for native command overwrites --- zsh/.zshrc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 4fd0cf0..d8a258e 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -9,12 +9,11 @@ eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" # ---- Native Command Overwrites ---- -alias vi="nvim" -alias vim="nvim" -alias cat="bat" -alias find="fd -H" -alias ls="eza --color=always --git --no-filesize --icons=always --no-time --no-user --no-permissions" -alias cd="z" +/usr/bin/which -s nvim && alias vi="nvim" && alias vim="nvim" || echo "nvim not found, falling back to vi" +/usr/bin/which -s bat && alias cat="bat" || echo "bat not found, falling back to cat" +/usr/bin/which -s fd && alias find="fd -H" || echo "fd not found, falling back to find" +/usr/bin/which -s zoxide && alias cd="z" || echo "zoxide not found, falling back to cd" +/usr/bin/which -s eza && alias ls="eza --color=always --git --no-filesize --icons=always --no-time --no-user --no-permissions" || echo "eza not found, falling back to ls" # ---- SSH Shortcuts ---- alias pandora="ssh root@pandora.cortex.io"