2008-04-06

viewing man pages with vim

There are two ways to use vim to display man pages. The first one is using vimmanpager and the second one is using the :Man command from within vim. Today I fixed bug 212844 which was a problem about vimmanpager and colour codes. You'll have to reinstall vim to get the updated vimmanpager.

To use vimmanpager as your default man pager build vim with vim-pager USE flag and set the environment variable MANPAGER to vimmanpager.

For those who want to use the command :Man from within vim, here is a trick to get things right. Add the following lines to your vimrc:
" make :Man command avaliable
source $VIMRUNTIME/ftplugin/man.vim
" Default MANPAGER vimmanpager doesn't play well
" with the :Man command and we don't want to see raw colour codes
" so we use sed to strip them.
let $MANPAGER = "sed -e 's:\\x1B\\[[[:digit:]]\\+m::g'"

Happy vimming :-)