Why there is no mdx highlight in treesitter? #3908
Replies: 5 comments 6 replies
-
Nobody contributed a parser and queries, that's why. (Maybe you can do it?) |
Beta Was this translation helpful? Give feedback.
-
Better than nothing:
|
Beta Was this translation helpful? Give feedback.
-
Also you can create a autocmd for set -- set markdown highlight for mdx file
autocmd({ "BufNewFile", "BufRead" }, {
pattern = { "*.mdx" },
callback = function()
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_option(buf, "filetype", "markdown")
end,
}) |
Beta Was this translation helpful? Give feedback.
-
An example by |
Beta Was this translation helpful? Give feedback.
-
NvChad GuideThis is the guide for someone who use NvChad, like me. Step 1Make sure you are in the Step 2Open the
Or if you prefer something simpler, but that won't activate other markdown filetype plugins you may want.
Step 3Notes: Things still work if you put the queries in In the
Repeat the process with another file name
And there you have it, next time you open nvim with a mdx file, everything is highlighted as you expected. |
Beta Was this translation helpful? Give feedback.
-
I want to highlight MDX in nvim. But ts didn't support syntax highlight or parsing for mdx.
Beta Was this translation helpful? Give feedback.
All reactions