back

by JNRowe·1y ago·view on hn ↗
When vim plugins change the effect of K, all they're likely doing is setting keywordprg¹. You can do the same yourself, fex to display info on the commit under cursor you'd use "setl kp=git\ show". You can write little script wrappers to fetch whatever custom resources you want, or you can up your game by writing vim commands so that you can use a count prefix to influence behaviour of the fetch too.

¹ https://vimdoc.sourceforge.net/htmldoc/options.html#'keyword...

2 comments
I've actually found this before but found it hard to parse and little third party information on the subject. I've been able to get K to show things like standard Python docs but not modules and not docs from the active working project. I'm sure there has to be a way considering ctags and jumps exist but I think I need a full weekend you at least unravel all the moving parts without third party explanation.
It’s worth noting that Vim has a lot of these *prg settings you can customize per file type: makeprg, formatprg, equalprg, etc.