You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.1 KiB
55 lines
1.1 KiB
return { |
|
"nvim-treesitter/nvim-treesitter", |
|
build = ":TSUpdate", |
|
event = { "BufReadPre", "BufNewFile" }, |
|
dependencies = { |
|
"nvim-treesitter/nvim-treesitter-textobjects", |
|
}, |
|
config = function() |
|
local treesitter = require("nvim-treesitter.configs") |
|
|
|
treesitter.setup({ |
|
-- enable syntax highlighting |
|
highlight = { |
|
enable = true, |
|
-- disable highlighting for large files |
|
disable = function(lang, buf) |
|
local max_filesize = 100 * 1024 -- 100 KB |
|
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) |
|
if ok and stats and stats.size > max_filesize then |
|
return true |
|
end |
|
end, |
|
}, |
|
-- enable indentation |
|
indent = { enable = false }, |
|
-- ensure these language parsers are installed |
|
ensure_installed = { |
|
"json", |
|
"javascript", |
|
"typescript", |
|
"tsx", |
|
"yaml", |
|
"html", |
|
"css", |
|
"prisma", |
|
"markdown", |
|
"markdown_inline", |
|
"svelte", |
|
"graphql", |
|
"bash", |
|
"lua", |
|
"vim", |
|
"dockerfile", |
|
"gitignore", |
|
"query", |
|
"vimdoc", |
|
"python", |
|
"go", |
|
"rust", |
|
"c", |
|
"cpp", |
|
}, |
|
}) |
|
end, |
|
}
|
|
|