lewis6991 / lewis6991/hover.nvim

Suggested mapping overrides help's K

Open
#1 6 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
744
Forks
58
PR merge metrics
No merged PRs in 30d

Description

In help files K can be used to jump to topic under the cursor. Suggested mapping overrides it. Neovim hover handler (vim.lsp.buf.hover) which I think many users have also mapped to K through on_attach function will not have that issue as it will not be mapped for help files. It makes sense to create global mapping for hover.nvim as it's useful beyond files with LSP attached. I have came up with following guard, not sure if it's the right way of doing it, but perhaps you can think of better way and update readme accordingly?

vim.keymap.set('n', 'K', function()
  if vim.bo.filetype ~= 'help' then
    require('hover').hover()
  end

  vim.api.nvim_feedkeys('K', 'ni', true)
end)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the hover.nvim README and the suggested global K mapping in the issue. Check how the mapping interacts with help buffers and the existing hover entry point, then document the supported behavior and verify that K still opens help topics while invoking hover elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.