From 36bd07a7e5eda5e401c5f4e3b85fa73bc87bc7e3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 10 Oct 2025 21:56:54 +0200 Subject: [PATCH] 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. --- nvim/.config/nvim/after/ftplugin/djot.lua | 3 +++ nvim/.config/nvim/after/ftplugin/vimwiki.lua | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 nvim/.config/nvim/after/ftplugin/vimwiki.lua diff --git a/nvim/.config/nvim/after/ftplugin/djot.lua b/nvim/.config/nvim/after/ftplugin/djot.lua index 8bdca83..d0bf301 100644 --- a/nvim/.config/nvim/after/ftplugin/djot.lua +++ b/nvim/.config/nvim/after/ftplugin/djot.lua @@ -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") diff --git a/nvim/.config/nvim/after/ftplugin/vimwiki.lua b/nvim/.config/nvim/after/ftplugin/vimwiki.lua new file mode 100644 index 0000000..4ec075d --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/vimwiki.lua @@ -0,0 +1,2 @@ +-- to make render-markdown render it nicely +vim.treesitter.language.register("markdown", "vimwiki")