zsh-bat/zsh-bat.plugin.zsh

19 lines
529 B
Bash
Raw Permalink Normal View History

2024-05-16 08:43:05 -05:00
BASEDIR=$(dirname "$0")
2020-09-23 02:38:28 -05:00
if command -v batcat >/dev/null 2>&1; then
# Save the original system `cat` under `rcat`
2020-09-23 02:38:28 -05:00
alias rcat=$(which cat)
# For Ubuntu and Debian-based `bat` packages
# the `bat` program is named `batcat` on these systems
alias cat=$(which batcat)
2024-05-16 08:43:05 -05:00
export MANPAGER="$BASEDIR/manbat batcat"
elif command -v bat >/dev/null 2>&1; then
# Save the original system `cat` under `rcat`
alias rcat=$(which cat)
# For all other systems
2020-09-23 02:38:28 -05:00
alias cat=$(which bat)
2024-05-16 08:43:05 -05:00
export MANPAGER="$BASEDIR/manbat bat"
2020-09-23 02:38:28 -05:00
fi