Skip to content

Instantly share code, notes, and snippets.

@juandesant
Last active January 3, 2016 06:39
Show Gist options
  • Save juandesant/8424548 to your computer and use it in GitHub Desktop.
Save juandesant/8424548 to your computer and use it in GitHub Desktop.
Inspired by `pman`, `sman` in Ask Different: http://apple.stackexchange.com/posts/5461/revisions
# Bash function (Mac OS X specific) for getting man pages
# in PDF visualized in Preview.app
# Tryit with `pdfman man`, `pdfman curl`, or `pdfman bash`, for instance.
pdfman() {
outname=/tmp/man-"$1".ps
man -t $1 > $outname # get PS version of man page in /tmp
if [ -s $outname ]
then {
open -a Preview $outname
}
fi
}
# similar command, to open clean manpage in TextMate
mateman() { man "${1}" | col -b | mate; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment