add support for Ubuntu and Debian `batcat` naming

This commit is contained in:
John P. Lettman 2023-08-14 19:08:32 -04:00 committed by Fabian Dellwing
parent d7d5df4f6c
commit a65c2e834a
1 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,17 @@
if command -v bat >/dev/null 2>&1; then
if command -v batcat >/dev/null 2>&1; then
# Save the original system `cat` under `rcat`
alias rcat=$(which cat)
# For Ubuntu and Debian-based `bat` packages
# the `bat` program is named `batcat` on these systems
alias cat=$(which batcat)
export MANPAGER="sh -c 'col -bx | batcat -l man -p'"
elif command -v bat >/dev/null 2>&1; then
# Save the original system `cat` under `rcat`
alias rcat=$(which cat)
# For all other systems
alias cat=$(which bat)
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
fi