Files
nvim/lua/plugins/treesitter.lua

38 lines
1.1 KiB
Lua

return {
"nvim-treesitter/nvim-treesitter",
build = function()
require("nvim-treesitter.install").update({ with_sync = true })()
end,
config = function()
require("nvim-treesitter.configs").setup({
-- List of parsers
ensure_installed = {
"vimdoc", "vim", "lua", "c", "rust", "cpp", "cmake", "latex", "python", "groovy", "bash", "zig", "go",
},
sync_install = false,
auto_install = true,
indent = {
enable = true
},
highlight = {
enable = true,
additional_vim_regex_highlighting = { "markdown" },
},
})
local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs()
treesitter_parser_config.templ = {
install_info = {
url = "https://github.com/vrischmann/tree-sitter-templ.git",
files = { "src/parser.c", "src/scanner.c" },
branch = "master",
},
}
vim.treesitter.language.register("templ", "templ")
end
}