Rendering Markdown in help buffers #500
-
I'm trying to ensure all
I was able to get this to work by adding the following to
Is this the only way, or am I missing something obvious? Searching for "Render neovim help buffers as markdown" is useless given the ubiquity of the word "help" and it's association with "neovim" in google's index. :) For bonus points, whenever a buffer with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
By default vim.treesitter.language.register('markdown', 'help') Which tells neovim to parse While this will technically "work" this doesn't actually change the contents of the help docs which are not written using In order to produce what I'm assuming you're looking for you'd need something to actively overwrite
I don't use the snacks picker so am unsure what you mean by the preview having "help content", but in general interacting with picker preview windows is not straightforward since they have things in place to speed up rendering that essentially make the buffer invisible to other plugins. Typically an integration needs to be added either with some option the plugin provides or directly in the code for the picker. |
Beta Was this translation helpful? Give feedback.
By default
help
files are parsed asvimdoc
. You can override this tomarkdown
by adding this line somewhere in your config:Which tells neovim to parse
help
files asmarkdown
without changing the filetype. You also need to keephelp
in theft
list for this plugin since thefiletype
has not been changed.While this will technically "work" this doesn't actually change the contents of the help docs which are not written using
markdown
so the results are probably worse than just usingtreesitter
with thevimdoc
parser installed. But if you like the result feel free to use it.