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:
parent
eb6e72c58d
commit
36bd07a7e5
2 changed files with 5 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
2
nvim/.config/nvim/after/ftplugin/vimwiki.lua
Normal file
2
nvim/.config/nvim/after/ftplugin/vimwiki.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-- to make render-markdown render it nicely
|
||||
vim.treesitter.language.register("markdown", "vimwiki")
|
||||
Loading…
Add table
Add a link
Reference in a new issue