diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2024-09-15 13:01:13 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2024-09-15 13:01:13 +0100 |
| commit | a66afa50b53444e50c06f829ef5c89f219d3492a (patch) | |
| tree | cb9a5f7f55b9a1fc671a5faab4455c6258a2995b | |
| parent | 141b372c7f3b6a88b019bd40267a3cd523018e89 (diff) | |
darwin/zsh: Alias ‘lsh’ to use ‘gls’ when possible
| -rw-r--r-- | dotfiles-darwin/zsh/rc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dotfiles-darwin/zsh/rc b/dotfiles-darwin/zsh/rc index bf2e952..7d01b7e 100644 --- a/dotfiles-darwin/zsh/rc +++ b/dotfiles-darwin/zsh/rc @@ -4,13 +4,13 @@ autoload -Uz vault alias df='df -Ph' alias ls='ls -G' -alias lsh='du -a | sort -h' alias pbclear='pbcopy </dev/null' alias pip=pip3 alias python=python3 alias rsync='rsync --exclude=.DS_Store' -if (( ${path[(I)/usr/local/opt/coreutils/libexec/gnubin]} )); then - alias ls='ls --color --group-directories-first' - alias lsh='ls -Shrs' +if (( ${+commands[gls]} )); then + alias lsh='gls -Shrs' +else + alias lsh='ls -Shlr | cut -f5- -w' fi |
