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()" vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
end 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() local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.htmldjango = { parser_config.htmldjango = {
install_info = { 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" }, files = { "src/parser.c" },
-- optional entries: -- optional entries:
branch = "paired-tags", -- default branch in case of git repo if different from master branch = "paired-tags", -- default branch in case of git repo if different from master
@@ -247,6 +250,7 @@ function M.nvim_treesitter()
filetype = "html", -- if filetype does not match the parser name filetype = "html", -- if filetype does not match the parser name
} }
end end
end
function M.nvim_lspconfig() function M.nvim_lspconfig()
vim.diagnostic.config({ vim.diagnostic.config({