diff --git a/.zshenv b/.zshenv index d9af8b8..10c7de6 100644 --- a/.zshenv +++ b/.zshenv @@ -1,3 +1,8 @@ +# ─< Check if the given command exists silently >───────────────────────────────────────── +command_exists() { + command -v "$@" >/dev/null 2>&1 +} + # ─< paths >────────────────────────────────────────────────────────────────────────────── if [ -d "$HOME/.local/bin" ]; then export PATH="$HOME/.local/bin:$PATH" @@ -6,7 +11,7 @@ if [ -d "$HOME/.local/bin" ]; then fi fi -if command -v nvim 2 >/dev/null &>1; then +if command_exists nvim; then export EDITOR="nvim" else # ─< linux binary via script installation >─────────────────────────────────────────────── diff --git a/.zshrc b/.zshrc index b59bc38..1cbe19f 100644 --- a/.zshrc +++ b/.zshrc @@ -1,5 +1,3 @@ -[[ -e "$HOME/.zshdef" ]] && . "$HOME/.zshdef" # <-- Defaults like echos and colors - # ─< Check if the given command exists silently >───────────────────────────────────────── command_exists() { command -v "$@" >/dev/null 2>&1