From 0eb19757a026070ece7f790bbf273c19a991f22e Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 4 Mar 2024 13:17:40 -0600 Subject: [PATCH] refactor(zsh): improve zsh `eza` aliases --- dots/.config/zsh/config/profile/profile/aliases.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dots/.config/zsh/config/profile/profile/aliases.zsh b/dots/.config/zsh/config/profile/profile/aliases.zsh index 6d605130..a1800d49 100644 --- a/dots/.config/zsh/config/profile/profile/aliases.zsh +++ b/dots/.config/zsh/config/profile/profile/aliases.zsh @@ -4,10 +4,17 @@ ### Eza ### if command -v eza >/dev/null 2>&1; then alias exa='eza' # This helps some preview commands work from separate repos - alias ls="eza --icons --group --group-directories-first --octal-permissions --classify" + alias ls="eza --icons=always --all --group-directories-first --long --header --octal-permissions --classify --group" alias l="ls -alh" alias ll="l" - alias tree="ls --tree" + tree() { + local cmd="ls --tree" + if [[ -n "${*}" ]]; then + eval "${cmd} ${@}" + else + eval "${cmd}" + fi + } fi ### Git ###