From 3450865acb063be6a9893f251fd878f64e786897 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Thu, 20 Aug 2020 10:46:35 +0200 Subject: [PATCH] Alias bat so it works for batcat --- .bash_aliases | 5 +++++ .config/fish/config.fish | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index ec90699..5f7bbe5 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -22,6 +22,11 @@ alias lll='ls --color=always -alF | less -R' # append history instead of overwriting: shopt -s histappend +if command -v batcat &> /dev/null; then + # Sometimes `bat` has the binary `batcat`, like on Debian or Ubuntu + alias bat='batcat' +fi + alias findphp='find . -name "*.php" | xargs grep --color=auto' alias findjs='find . -name "*.js" | xargs grep --color=auto' alias findcss='find . -name "*.css" | xargs grep --color=auto' diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 73e83e0..7233c01 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -98,6 +98,9 @@ function grepl grep --color=always -ir $argv | less -R end +# Sometimes `bat` has the binary `batcat`, like on Debian or Ubuntu +alias bat (command -v batcat || echo bat) + function rgl rg -p $argv | less -RFX end