From 2c7be2b3f5b68ecb6d55097e97dccbeb58d12246 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 27 Sep 2023 13:18:44 +0200 Subject: Change fish alias for ls=eza and cat=bat if those program are installed --- config/fish/config.fish | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'config/fish/config.fish') diff --git a/config/fish/config.fish b/config/fish/config.fish index fa2f40f..dfefe8e 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -115,10 +115,14 @@ if status is-interactive alias arduino-cli='arduino-cli --config-file $XDG_CONFIG_HOME/arduino15/arduino-cli.yaml' # alias nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings - if [ "$(uname)" = 'Linux' ] - alias ls='ls --color=auto -Fh' + if command -qv eza + alias ls='eza --git --git-repos --mounts --classify --icons' else - alias ls='ls -G -Fh' + if [ "$(uname)" = 'Linux' ] + alias ls='ls --color=auto -Fh' + else + alias ls='ls -G -Fh' + end end abbr ll 'ls -l' abbr la 'ls -A' @@ -126,13 +130,20 @@ if status is-interactive abbr lss 'ls -Ssh' # tree - alias tree 'tree -FC' + if command -qv eza + alias tree='ls -T' + alias ti="ls -T --git-ignore" + else + alias tree 'tree -FC' + alias ti="tree --matchdirs -I __pycache__ -I node_modules -I '*.o' -I build" + end abbr t 'tree' abbr ta 'tree -a' abbr t1 'tree -L 1' abbr t2 'tree -L 2' abbr t3 'tree -L 3' - alias ti="tree --matchdirs -I __pycache__ -I node_modules -I '*.o' -I build" + + command -qv bat && alias cat='bat' # git abbr ga 'git add' -- cgit