1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 19:30:01 +02:00
dotfiles/nvim/lua/plugins/treesitter.lua

78 lines
1.7 KiB
Lua

return {
'nvim-treesitter/nvim-treesitter',
build = function()
require('nvim-treesitter.install').update({ with_sync = true })
end,
dependencies = {
'nvim-treesitter/playground'
},
opts = {
-- A list of parser names
ensure_installed = {
"bash",
"c",
"cpp",
"ninja",
"cmake",
"make",
"lua",
"vim",
"vimdoc",
"query",
"php",
"blade",
"go",
"javascript",
"typescript",
"css",
"scss",
"html",
"vue",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"glsl",
"hlsl",
"markdown"
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = false,
highlight = {
enable = true,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
-- indent = {
-- enable = true
--}
},
config = function(_, opts)
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
parser_config.blade = {
install_info = {
url = 'https://github.com/EmranMR/tree-sitter-blade',
branch = "main",
files = { 'src/parser.c' },
generate_requires_npm = true,
requires_generate_from_grammar = true,
},
filetype = 'blade',
}
require("nvim-treesitter.configs").setup(opts)
end,
}