We know that pressing 'K' will trigger the manual page for the underlying language. I am writing a syntax file for a language, and the document is online only. So I would like to knowHow do I react to 'K'?How do I, rather than calling man on that keyword, pop up a new browser window and open the given page?Thanks!
Use K on a custom language
key bindings;vimscript
Pressing K runs the program given by keywordprg (kp).If you do :set keywordprg? it should reply keywordprg=man by default.So simply set keywordprg to a program of choice, which will get the language name as input. Check if the language is the one you want and fire it up in the browser, otherwise call man on the input as usual.:help K tells you this and more