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
Woah, a Korn shell user. 👀

@justine

Why do you rewrite a new man function?

I dont understand why you added `col -bx`? Option `-l` seems to arrange the text in columns; what is the diff?

col(1) - OpenBSD manual pages

@justine

Excuse-me, but I dont understand more! :(
I've read the col manpage, (before asking) but I dont understand why adding it to bat!

Sorry trying to remember where I got that from but was something related to this.

https://sebastiano.tronto.net/blog/2022-09-05-man-col/
Pipe man into col -b to get rid of ^H | Sebastiano Tronto

@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.

@obj Hope to see https://github.com/plp13/qman soon in ports 🖖🏻
GitHub - plp13/qman: A more modern man page viewer for our terminals

A more modern man page viewer for our terminals. Contribute to plp13/qman development by creating an account on GitHub.

GitHub

@ricardo @obj
Even beautifuller man pages on #OpenBSD with mandoc (and mupdf as pdf-viewer)

$ bman () { man -w "$1" | xargs mandoc -T pdf > /tmp/"$1".pdf; mupdf /tmp/"$1".pdf ; rm /tmp/"$1".pdf; }
$ bman less

@obj
I use neovim as my pager here - also pretty cool 🙂

export MANPAGER='nvim +Man!'