TIL: vim K#

I was having fun with my Neovim config, but do not know the Lua API at all.

That’s why I was looking to find help for a word under my cursor. Thus, I googled “neovim open help under cursor”. Ingo Karkat delivered on Stackoverflow:

Just press K.

Nice!

../_images/nvim-k.png

Any motion clears the overlay window, but pressing K again, puts your cursor into it, so you can search, select, navigate, or even :q the window. 🤓

Correction: Actuall, K normally runs 'keywordprg', which defaults to man. The magic described above comes from vim.lsp.buf.hover and TJ’s custom mapping of K in kickstart.nvim.