markdown-preview.nvim icon indicating copy to clipboard operation
markdown-preview.nvim copied to clipboard

Support: Can we get mdx support?

Open zelfroster opened this issue 2 years ago • 3 comments

MDX Support

I have setup my blog using mdx. I thought mdx is supported by this plugin. But sadly it doesn't. Can we get MDX support?

zelfroster avatar Feb 05 '23 13:02 zelfroster

Waiting the same :3

linuxmobile avatar Apr 14 '23 01:04 linuxmobile

All you need to do is let nvim assign the markdown filetype to the mdx files. One way to do this is to create a ~/.config/nvim/after/ftdetect/mdx.lua file with the following contents:

local mdx_id = vim.api.nvim_create_augroup("mdx", {
  clear = false
})
vim.api.nvim_create_autocmd("BufEnter", {
  group = mdx_id,
  pattern = "*.mdx",
  callback = function()
    vim.o.filetype = "markdown"
  end
})

jakubbortlik avatar Jun 10 '24 12:06 jakubbortlik

not sure if it's the right way, but this is what i did: vim.cmd([[autocmd BufNewFile,BufRead *.mdx set filetype=markdown]])

bruteforks avatar Jun 21 '24 23:06 bruteforks