From a65c2e834a42d3d7bfc363b3ab1846433ee5778a Mon Sep 17 00:00:00 2001 From: "John P. Lettman" Date: Mon, 14 Aug 2023 19:08:32 -0400 Subject: [PATCH] add support for Ubuntu and Debian `batcat` naming --- zsh-bat.plugin.zsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/zsh-bat.plugin.zsh b/zsh-bat.plugin.zsh index 6e867c4..9cadeb8 100644 --- a/zsh-bat.plugin.zsh +++ b/zsh-bat.plugin.zsh @@ -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