Browse Source

Add aliases for exa, a modern replacement for ls

Emmanuel Bouthenot 4 years ago
parent
commit
589f04b83a
1 changed files with 15 additions and 3 deletions
  1. 15 3
      .zsh/config/10_alias.zsh

+ 15 - 3
.zsh/config/10_alias.zsh

@@ -23,9 +23,21 @@ export GIT_PAGER="$PAGER"
 # Common aliases / functions
 #
 
-export QUOTING_STYLE='literal'
-alias ls='ls --group-directories-first --color=auto'
-alias l='ls --group-directories-first -lsh --color=auto'
+if (( $+commands[exa] )); then
+    alias ls='exa --group-directories-first'
+    alias l='exa --long --grid --group-directories-first --header --blocks --inode --header --group'
+    alias lg='exa --long --group-directories-first --grid'
+    alias la='exa --all --long --grid --group-directories-first --header --blocks --inode --header --group'
+    alias lt='exa --group-directories-first --tree'
+else
+    export QUOTING_STYLE='literal'
+    alias ls='ls --group-directories-first --color=auto'
+    alias l='ls --group-directories-first -lsh --color=auto'
+    alias la='ls --group-directories-first -lsha --color=auto'
+    if (( $+commands[exa] )); then
+        alias lt='tree'
+    fi
+fi
 
 alias rm='rm -i'
 alias mv='mv -i'