Files
nvim/lua/rua/plugins/treesitter.lua
2025-01-08 09:53:06 +08:00

56 lines
1.0 KiB
Lua

return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
opts = {
indent = { enable = true },
ensure_installed = {
-- defaults
"vim",
"vimdoc",
"lua",
-- web dev
"html",
"css",
"javascript",
"typescript",
"tsx",
"json5",
"vue",
"markdown",
"markdown_inline",
"jsdoc",
"scss",
"styled", -- styled components
-- low level
"rust",
"ron",
"toml",
"go",
"gomod",
"gowork",
"gosum",
"sql",
-- git
"git_config",
"gitcommit",
"git_rebase",
"gitignore",
"gitattributes",
},
auto_install = true,
highlight = {
enable = function()
return not vim.b.large_buf
end,
disable = function()
return vim.b.large_buf
end,
},
},
---@param opts TSConfig
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
}