From 6e42cd67e5f07dacd18e9e6b5776583a14a2e4e8 Mon Sep 17 00:00:00 2001 From: Frederic Houdemer Date: Tue, 19 Mar 2024 22:10:33 +0100 Subject: [PATCH] :sparkles: add markdown to treesitter + mdx files as markdown --- init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 476988d7..bf3c9cd7 100644 --- a/init.lua +++ b/init.lua @@ -466,7 +466,7 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = vim.defer_fn(function() require('nvim-treesitter.configs').setup { -- 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!) 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` -- vim: ts=2 sts=2 sw=2 et