mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-20 04:06:29 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user