Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added aliases for the new "official" fork eza instead of exa #277

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading