Wednesday, February 13, 2008

Browsing man Pages in the Editor

I don't like using more or less to look through man pages. Like info, it just gives me one more, not-quite-familiar set of keystrokes to learn for looking through text.

For years, I'd just save the formatted page, strip backspaces and fake bolding with col -b, and then pull it into the editor.

Today, I use an environment variable to tell man that I want it to do all that for me. Here's how to do it for vi, which is now in my firmware. If you use emacs or kate or gedit or something else, and know an incantation, post it in a comment.
$ export PAGER="/bin/sh -c \"col -b | view -c 'set ft=man nomod nolist' -\""

No comments: