Skip to content

[idea] K keymap for LSP hover — the conventional binding is unset #269

Description

@stanfish06

What

Add K as a buffer-local keymap for vim.lsp.buf.hover() inside the LspAttach callback. K is the Neovim convention for "show documentation under cursor" and has been so since before LSP — but the config's LspAttach only binds gd and <leader>la, leaving K unset.

-- inside the LspAttach callback in plugin_config.lua
vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = ev.buf, desc = "LSP hover docs" })

Where

lua/config/plugin_config.lua:129 — inside the LspAttach autocmd callback, next to gd and <leader>la.

Why it matters

K (:help K) defaults to running keywordprg (usually man), which is useless in code files. Every LSP guide and plugin ecosystem assumes K is hover — users expect it, help text for refactoring.nvim, blink.cmp, and gitsigns refer to it. Without it, the only way to read hover documentation is via blink.cmp's completion popup or the command line :lua vim.lsp.buf.hover(). Adding it is a single line inside the existing LspAttach block. See also #259 for a more advanced persistent hover variant — that issue can be implemented after this baseline K is in place.

Recommended action

Add K → vim.lsp.buf.hover as a buffer-local keymap in the LspAttach callback. Optionally also add gK for signature help (vim.lsp.buf.signature_help), which is the other widely-expected LSP keymap missing from the current set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions