summaryrefslogtreecommitdiff
path: root/.config/shell/aliasrc
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2024-10-16 20:14:42 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2024-10-16 20:14:42 -0600
commitddb531fb7fc1843f2555a0070b019b413769f912 (patch)
treec5e9cbb46c8724165fabdb360b6b9fcc757e675e /.config/shell/aliasrc
parentaf57f168c44ef668150c4c2c3b4d22d7eddaa0ea (diff)
feat: support exa(eza)
Diffstat (limited to '.config/shell/aliasrc')
-rw-r--r--.config/shell/aliasrc15
1 files changed, 12 insertions, 3 deletions
diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc
index ce747f2..ef97b3a 100644
--- a/.config/shell/aliasrc
+++ b/.config/shell/aliasrc
@@ -1,7 +1,7 @@
#!/bin/sh
# vim selection
-command -v nvim &> /dev/null && alias vim="nvim" vimdiff="nvim -d" vi="nvim"
+command -v nvim >/dev/null 2>&1 && alias vim="nvim" vimdiff="nvim -d" vi="nvim"
# verbosity
alias cp="cp -iv"
@@ -9,12 +9,21 @@ alias mv="mv -iv"
alias rm="rm -iv"
alias mkdir="mkdir -pv"
-# ls and use color when available
-alias ls="ls -Ah --color=always --group-directories-first"
+# always use color when available
+# exa (exa) instead of ls when available
+if command -v eza >/dev/null 2>&1; then
+ alias ls="eza -aH --color=automatic --group-directories-first --git"
+ alias ll="ls -l"
+ alias lt="ls -TL 6"
+else
+ alias ls="ls -Ah --color=always --group-directories-first"
alias ll="ls -l"
alias lll="ls -ltr"
+fi
+
alias grep="grep --color=auto"
alias diff="diff --color=auto"
# dotfiles bare repository management
+# shellcheck disable=SC2139
alias dots="/usr/bin/git --git-dir=$HOME/.mdots/ --work-tree=$HOME"