From e439f557c45178e646d11b6dbc9b11d393ba8faa Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Mon, 23 Dec 2024 16:56:25 -0300 Subject: [PATCH] feat: language aliases for markdown codeblocks --- lua/dot013/plugins/treesitter.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/dot013/plugins/treesitter.lua b/lua/dot013/plugins/treesitter.lua index 2ab05c5..d35f352 100644 --- a/lua/dot013/plugins/treesitter.lua +++ b/lua/dot013/plugins/treesitter.lua @@ -94,8 +94,17 @@ return { lint_events = { "BugWrite", "CursorHold" }, }, }) + + local LANGUAGE_ALIASES = { + { from = "dataviewjs", to = "javascript" }, + { from = "js", to = "javascript" }, + { from = "ts", to = "typescript" }, + } + for _, v in pairs(LANGUAGE_ALIASES) do + vim.treesitter.language.register(v.to, v.from) + end end, }, - { "nvim-treesitter-textobjects", dep_of = { "nvim-treesitter" } }, + { "nvim-treesitter-textobjects", dep_of = { "nvim-treesitter" } }, { "nvim-treesitter-textsubjects", dep_of = { "nvim-treesitter" } }, }