fix(fish): guard nvim aliases and add eza fallbacks

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.
This commit is contained in:
2026-03-20 04:21:10 +02:00
parent f2a3ae9a4b
commit 3a1461a647
2 changed files with 21 additions and 3 deletions

View File

@@ -1,7 +1,9 @@
# Set aliases for fish shell # Set aliases for fish shell
alias vim='nvim' if type -q nvim
alias vi='nvim' alias vim='nvim'
alias vi='nvim'
end
# eza aliases if eza is installed # eza aliases if eza is installed
if type -q eza >/dev/null if type -q eza >/dev/null
@@ -31,6 +33,19 @@ if type -q eza >/dev/null
function l --wraps='eza_git' --description eza function l --wraps='eza_git' --description eza
eza_git $argv eza_git $argv
end 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 end
# Edit fish alias file # Edit fish alias file
@@ -130,4 +145,6 @@ alias x-datetime="date +'%Y-%m-%d %H:%M:%S'"
alias x-timestamp="date +'%s'" alias x-timestamp="date +'%s'"
# Random abbreviations # 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

View File

@@ -52,3 +52,4 @@ source ~/.orbstack/shell/init2.fish 2>/dev/null || :
if status is-interactive; and not set -q GITHUB_TOKEN if status is-interactive; and not set -q GITHUB_TOKEN
echo "Warning: GITHUB_TOKEN is not set" >&2 echo "Warning: GITHUB_TOKEN is not set" >&2
end end
eval "$(/opt/homebrew/bin/brew shellenv fish)"