Tell HN: On macOS, `man-preview` opens man pages in Preview
Basically the title. I'm ok with man pages; can navigate using typical Vim keybindings. But sometimes it's nice to see them as a PDF where you can quickly find the information you're looking for.
I thought maybe others will find it useful too.
20 comments
[ 4.3 ms ] story [ 46.4 ms ] threadSeems to just be a short script:
which man-preview man-preview () { man -w "$@" &> /dev/null && man -t "$@" | open -f -a Preview || man "$@" }
man-preview () { man -w "$@" &> /dev/null && man -t "$@" | ps2pdf - - | open -f -a Preview || man "$@" }
https://github.com/ohmyzsh/ohmyzsh/pull/11324
man-preview not found
For example, this heading order is generally my preferred one:
Author, See Also, Example / Uses, Description, (and I typically find that I already know the Name but it's OK to add that at the end :-))
This comes from some personal preference, but is also informed by my professional work in coaching tech professionals.
In studying personality differences in tech, and listening to others' experiences in learning about tech, I developed a theory that a huge number of us get stuck attempting to read tech materials which were written by/from a completely opposite perspective (compared to our personal style) on why one reads, and what makes things readable.
This is like being nearsighted and borrowing a farsighted person's glasses, expecting them to work because glasses are what you wear to fix your eyesight.
In documentation, these two styles tend to draw battle lines around what you could call the man-forward or man-backward learning styles, IMO ;-)
`tldr` is one example of a countering man-backward app-psychology that is available and a fix for some of us, in some ways. But until the day of reconciliation arrives, I will continue to periodically leap forward and scroll backward...
``` manps () { if [ -z "$1" ] then echo usage: $FUNCNAME topic echo This will open a PostScript formatted version of the man page for \'topic\'. else man -t $1 | open -f -a /System/Applications/Preview.app fi }
```
'man-preview' seems zsh only.
man-preview not found