optional loading of htmldjango treesitter

This commit is contained in:
2023-01-08 16:47:11 -06:00
parent 20590fc199
commit 12159d1fdf
+5 -1
View File
@@ -234,10 +234,13 @@ function M.nvim_treesitter()
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
end
local htmldjango_path = "/home/guy/code/treesitter/tree-sitter-htmldjango-myown"
if vim.fn.filereadable(htmldjango_path) then
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.htmldjango = {
install_info = {
url = "/home/guy/code/treesitter/tree-sitter-htmldjango-myown", -- local path or git repo
url = htmldjango_path, -- local path or git repo
files = { "src/parser.c" },
-- optional entries:
branch = "paired-tags", -- default branch in case of git repo if different from master
@@ -246,6 +249,7 @@ function M.nvim_treesitter()
},
filetype = "html", -- if filetype does not match the parser name
}
end
end
function M.nvim_lspconfig()