nvim: Enable markdown rendering for vimwiki and djot

The reason render-markdown was not working for either is that it
requires the markdown treesitter active for the respective language.
With this, for the filetypes in question we simply tell the markdown
treesitter to also parse these.

This _might_ be a problem in the future if the djot treesitter (which
also exists and can be enabled by TS in nvim) diverges more or some
other unforeseen change happens. For now, it seems to work fine. Might
not support all the features in djot that diverge from md? I have not
used them extensively enough to notice.
This commit is contained in:
Marty Oehme 2025-10-10 21:56:54 +02:00
parent eb6e72c58d
commit 36bd07a7e5
Signed by: Marty
GPG key ID: 4E535BC19C61886E
2 changed files with 5 additions and 0 deletions

View file

@ -1,2 +1,5 @@
-- just copy markdown settings
vim.cmd.runtime({"after/ftplugin/markdown.lua", bang=true})
-- until there's a specific djot TS, use markdown
vim.treesitter.language.register("markdown", "djot")

View file

@ -0,0 +1,2 @@
-- to make render-markdown render it nicely
vim.treesitter.language.register("markdown", "vimwiki")