1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

fish/functions: add fallback options if non-standard commands does not exist.

This commit is contained in:
Henrik Hautakoski 2024-12-17 22:59:45 +01:00
parent a834fa9efd
commit f66093b0ef
4 changed files with 24 additions and 9 deletions

View file

@ -1,4 +1,7 @@
function cat --wraps='bat -pn' --wraps='bat -pn --pager=never' --description 'alias cat bat -pn --pager=never'
bat -pn --pager=never $argv
function cat
if test -f /usr/bin/bat
/usr/bin/bat -p --pager=never $argv
else
/bin/cat $argv
end
end

View file

@ -1,3 +1,7 @@
function ll --wraps=ls --wraps='eza -l --git' --wraps='eza --icons=always -l --git' --description 'alias ll eza --icons=always -l --git'
eza --icons=always -l --git $argv
function ll
if test -f /usr/bin/eza
/usr/bin/eza --icons=always -l --git $argv
else
/bin/ls -l $argv
end
end

View file

@ -1,3 +1,7 @@
function ls --wraps=eza --description 'alias ls eza'
eza $argv
function ls
if test -f /usr/bin/eza
/usr/bin/eza $argv
else
/bin/ls --color=auto $argv
end
end

View file

@ -1,3 +1,7 @@
function tree --wraps='eza -T' --description 'alias tree eza -T'
eza -T $argv
function tree
if test -f /usr/bin/eza
/usr/bin/eza -T $argv
else
/bin/tree $argv
end
end