From c51e6b989f4907198e02a4dc95192fd4c8b4f0cb Mon Sep 17 00:00:00 2001 From: neiromaster Date: Tue, 3 Oct 2023 17:53:56 +0300 Subject: [PATCH] Added aliases for the new "official" fork eza instead of exa Signed-off-by: Maxim Gavrilenko --- zsh/.zshrc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index ed07d51..80c8d43 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -568,23 +568,28 @@ if (( $+commands[gls] )); then alias la='gls -A --color' fi -# When present, use exa instead of ls -if can_haz exa; then - if [[ -z "$EXA_TREE_IGNORE" ]]; then - EXA_TREE_IGNORE=".cache|cache|node_modules|vendor|.git" - fi +# When present, use exa or eza (newest) instead of ls +if can_haz eza; then + ls_analog='eza' +elif can_haz exa; then + ls_analog='exa' +fi - if [[ "$(exa --help | grep -c git)" == 0 ]]; then +if [ -v ls_analog ]; then + if [[ "$($ls_analog --help | grep -c git)" == 0 ]]; then # Not every linux exa build has git support compiled in - alias l='exa -al --icons --time-style=long-iso --group-directories-first --color-scale' + alias l="$ls_analog -al --icons --time-style=long-iso --group-directories-first --color-scale" else - alias l='exa -al --icons --git --time-style=long-iso --group-directories-first --color-scale' + alias l="$ls_analog -al --icons --git --time-style=long-iso --group-directories-first --color-scale" fi - alias ls='exa --group-directories-first' + alias ls="$ls_analog --group-directories-first" # Don't step on system-installed tree command if ! can_haz tree; then - alias tree='exa --tree' + if [[ -z "$TREE_IGNORE" ]]; then + TREE_IGNORE=".cache|cache|node_modules|vendor|.git" + fi + alias tree="$ls_analog --tree --ignore-glob='$TREE_IGNORE'" fi fi