aboutsummaryrefslogtreecommitdiffstats
path: root/lua/plugins/treesitter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins/treesitter.lua')
-rw-r--r--lua/plugins/treesitter.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua
index 80f98cf..aa17471 100644
--- a/lua/plugins/treesitter.lua
+++ b/lua/plugins/treesitter.lua
@@ -29,7 +29,10 @@ return {
'TSPlaygroundToggle',
},
opts = {
- endwise = { enable = true },
+ endwise = {
+ enable = true,
+ disable = { "markdown", "markdown_inline" },
+ },
auto_install = true,
ensure_installed = {
"bash",
@@ -68,6 +71,10 @@ return {
},
highlight = {
enable = true,
+ disable = function(_, buf)
+ local ft = vim.bo[buf].filetype
+ return ft == "oil" or ft == "snacks_notif"
+ end,
additional_vim_regex_highlighting = { "org" },
},
playground = {
@@ -83,6 +90,7 @@ return {
},
indent = {
enable = true,
+ disable = { "oil", "snacks_notif" },
},
textobjects = {
select = {
@@ -125,6 +133,15 @@ return {
}
})
+ -- Reuse markdown parser for plugin-specific scratch buffers.
+ vim.treesitter.language.register("markdown", "codecompanion")
+ vim.treesitter.language.register("markdown", "snacks_notif")
+ vim.treesitter.language.register("markdown", "oil")
+
+ -- Some markdown injections generated by external plugins can point to
+ -- placeholder languages and crash parser injection resolution.
+ pcall(vim.treesitter.query.set, "markdown", "injections", "")
+
require(plug.main).setup(config);
end,
}