This will look up the word under the cursor in a new gnome-terminal. If you press a number key first, it looks only in that manual section (unless the number is 1, in which case you don't need it anyway...). There is one small bug when you try to look in a particular section while near the end of the file, as this results in an Invalid Range error. Just add a few blank lines at the bottom to work around this issue.

References

The col command may differ on your version of Unix, see col(1) for details.

Comments

Addendum:

"AFTER THIS:

" and delete it:
:exe ":delete"

" ADD THIS!:

" finally set file type to 'man':
:exe ":set filetype=man"

Which formats the page for man type (make sure to 'setenv TERM xterm' first or similar to see the pwetty colours :)

Note that if you're using a recent version of groff, you may have to disable SGR (Ansi escape sequences) in order to view man pages within vim. If you see a whole lot of garbage on the screen, try adding to your .vimrc the line:

let $GROFF_NO_SGR=1

Also take a look at ":e $VIMRUNTIME/ftplugin/man.vim".

I'd rather put in my ~/.vimrc:

source $VIMRUNTIME/ftplugin/man.vim
nnoremap K :Man <C-R><C-W><CR>

I had the problem that it would open the new window, but loaded the man page itself into the old window. Changing:

:exe ":wincmd n"

to

:exe ":new"

fixed it for me.

Of course, you could use script#489 to do this, too. In addition, one gets :Man topic as well as the use of K to look up the word under the cursor.