hovercraft.nvim icon indicating copy to clipboard operation
hovercraft.nvim copied to clipboard

Manpages provider only searches for certain sections

Open PsychedelicOrange opened this issue 3 months ago • 3 comments

I couldn't make man pages from man3 section show up. Turns out Man provider only searches for certain sections, (n or '1'). Assuming n is for tcl stuff

  local word = vim.fn.expand('<cword>')
  local uri
  if vim.bo[opts.bufnr].filetype == 'tcl' then
	uri = string.format('man://%s(n)', word)
  else
	uri = string.format('man://%s', word)
  end

should work better ? Maybe could be behind a config ? I don't know what people would prefer.

PsychedelicOrange avatar Sep 13 '25 06:09 PsychedelicOrange

Hey 🙂 Can you give me an example of what exactly you want to achieve?

E.g. if I create a buffer with ft=c with the following content (ignoring that this will not run 😅):

void main() {
  accept(); // <-- put cursor at accept
}

and move the cursor over accept and open hovercraft.nvim with the Man provider, it will show me the docs for accept from section 2.

A concrete example would be highly appreciated, since I guess I do not fully understand the problem at hand.

patrickpichler avatar Sep 27 '25 10:09 patrickpichler

I am trying to make vulkan man3 pages show up when i hover on vulkan functions. I got it working when i changed the code to above shared to snippet

PsychedelicOrange avatar Sep 27 '25 15:09 PsychedelicOrange

That is interesting! Can you share some code snippet and man pages for me to test?

patrickpichler avatar Oct 07 '25 17:10 patrickpichler