Reading man pages with vim

You can use Vim to read the manpages of certain functions. If your cursor is over a function (word) and you press K it will load up the manpage for that keyword. By default it will load the standard linux manpages, but you can map it to something appropriate for the language you're editing.

" Map K to the appropriate man page program depending on language
:au FileType perl setlocal keywordprg="perldoc -f"
:au FileType php setlocal keywordprg=pman
Leave A Reply
All content licensed under the Creative Commons License