Search JDK help for keyword at cursor
From Vim Tips Wiki
created April 5, 2002 · complexity basic · author Sean Richards · version 6.0
If you are using the Win32 version of Vim you can use this tip to search the Jdk help for the keyword under the cursor.
You need the winhlp32 version of the Jdk docs from this URL - http://www.confluent.fr/javadoc/indexe.html.
It is a 16mb D/L and approx 85mb unzipped!
I added a command to the popup menu
:amenu PopUp.JavaHelp :!start winhlp32 -k <cword> F:\jdk\winhelp\JDK13.HLP <CR
And also made a keymapping
map J :!start winhlp32 -k <cword> F:\jdk\winhelp\JDK13.HLP <CR>
Here is one for ColdFusion programmers on Windows:
map K :!"C:\Program Files\Internet Explorer\iexplore.exe" <cword><CR> http://servername/cfdocs/searchmain.cfm?searchstring=<cword><CR>;
where "servername" is the name of a server that has the ColdFusion documentation installed.
By the way, I mapped it to K because K is Vim's default "help on keyword under cursor" function, which (traditionally) calls up the Unix 'man' program. Vim on Windows doesn't use man, though, so it makes sense to map that to something specific to the language I use most. (If you work with multiple languages, why not add language-specific K mappings for each to filetype.vim? You could get the right help program for whichever language you were working with.)
In a standard Vim install, J is used in command-mode to join together two lines of text. I find it very useful -- it allows me to bring the next line up without moving my cursor around.