From 3a1461a647841dc9987dc5c17b3e97446d1019e3 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Fri, 20 Mar 2026 04:21:10 +0200 Subject: [PATCH] fix(fish): guard nvim aliases and add eza fallbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guard vim/vi → nvim aliases with type -q nvim check so they only activate when nvim is installed. Add ls/ll/l/lsa fallbacks when eza is not installed. Add brew shellenv fish eval in config.fish. --- config/fish/alias.fish | 23 ++++++++++++++++++++--- config/fish/config.fish | 1 + 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/config/fish/alias.fish b/config/fish/alias.fish index be5a42a..832cb9d 100644 --- a/config/fish/alias.fish +++ b/config/fish/alias.fish @@ -1,7 +1,9 @@ # Set aliases for fish shell -alias vim='nvim' -alias vi='nvim' +if type -q nvim + alias vim='nvim' + alias vi='nvim' +end # eza aliases if eza is installed if type -q eza >/dev/null @@ -31,6 +33,19 @@ if type -q eza >/dev/null function l --wraps='eza_git' --description eza eza_git $argv end +else + function ls --description 'ls (system fallback)' + command ls $argv + end + function ll --description 'ls -lh (system fallback)' + command ls -lh $argv + end + function l --description 'ls (system fallback)' + command ls $argv + end + function lsa --description 'ls -lah (system fallback)' + command ls -lah $argv + end end # Edit fish alias file @@ -130,4 +145,6 @@ alias x-datetime="date +'%Y-%m-%d %H:%M:%S'" alias x-timestamp="date +'%s'" # Random abbreviations -abbr --add stats onefetch --nerd-fonts --true-color never +if type -q onefetch + abbr --add stats onefetch --nerd-fonts --true-color never +end diff --git a/config/fish/config.fish b/config/fish/config.fish index 6ad245b..b551cf7 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -52,3 +52,4 @@ source ~/.orbstack/shell/init2.fish 2>/dev/null || : if status is-interactive; and not set -q GITHUB_TOKEN echo "Warning: GITHUB_TOKEN is not set" >&2 end +eval "$(/opt/homebrew/bin/brew shellenv fish)"