Beautiful man pages on #OpenBSD with bat 🐱
$ doas pkg_add bat
$ man pf.conf | bat -pl man
I have the following set in my .kshrc to do exactly that.

# coloured man pages
man() {
sh -c "man '$@' | col -bx | bat -l man"
}

@justine @obj i use zsh on my OpenBSD boxes, this is what i came up with:

if command -v bat &> /dev/null; then zsh-defer eval $(bat --completion zsh) export BAT_THEME=ansi alias cat="bat -pp" alias bat="bat -p" # colored manpages function man { sh -c "man '$@' | col -bx | \bat -pl man" } # colored -h and --help alias -g -- -h='-h 2>&1 | \bat -pl help' alias -g -- --help='--help 2>&1 | \bat -pl help' # help command function help { sh -c "'$@' --help 2>&1 | \bat -pl help" } fi

the if command -v bat bit is nice to have in case bat for whatever reason isn’t on your system.