add markdown to treesitter + mdx files as markdown

This commit is contained in:
Frederic Houdemer 2024-03-19 22:10:33 +01:00
parent a6def72538
commit 6e42cd67e5
1 changed files with 8 additions and 1 deletions

View File

@ -466,7 +466,7 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
vim.defer_fn(function() vim.defer_fn(function()
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'go', 'lua', 'python', 'tsx', 'javascript', 'typescript', 'vimdoc', 'bash' , 'make', 'php', 'helm', 'yaml'}, ensure_installed = { 'go', 'lua', 'python', 'tsx', 'javascript', 'typescript', 'vimdoc', 'bash' , 'make', 'php', 'helm', 'yaml', 'markdown'},
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = false,
@ -714,5 +714,12 @@ cmp.setup {
}, },
} }
-- Add MDX support fox markdown
vim.filetype.add({
extension = {
mdx = 'mdx'
}
})
vim.treesitter.language.register('markdown', 'mdx')
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et