Wondering what the “vim-pager” use flag on app-editors/vim did, I gave it a shot. Turns out it gives you 2 extra commands: vimpager and vimmanpager. So adding
export MANPAGER=/usr/bin/vimmanpager
to your login script of choice (.bashrc works just fine), man will use vim as a pager, complete with systax highlighting and ability to use the mouse scroll wheel and other such fun things to navigate man pages.
You could also set PAGER (and/or alias less) to vimpager, but I found that vimpager waits for EOF before displaying anything, meaning it won’t work for commands that run until interupted, and commands that run for a long time wait until completion to show anything at all.
UPDATE to ask: If anyone knows a way to use this but to use the colors from a program with color output, eg. “ls –color=always | vimpager”, please let me know.
2 Comments
I normally wouldn’t comment on something of this nature, but this is one of the coolest things I’ve seen in a long time. Much more interesting than most of the crap you read in blogs (including mine for that matter lol). Nice.
There’s also Most… This is a very good pager, with color support.
One Trackback
[...] 23, 2009 at 7:32 am (Linux) Man pages by default use less for displaying. I’ve used vim before to for colored text in man pages but something got bjorked in an update. You can color man pages [...]