Files
sunhat/configs/dotfiles/nvim/lua/gib_nvim/treesitter.lua
2025-05-22 17:56:05 -05:00

65 lines
1.6 KiB
Lua

require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all"
ensure_installed = {
"bash",
"c",
"cmake",
"cpp",
"css",
"dockerfile",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"haskell",
"html",
"java",
"javascript",
"json",
"kotlin",
"lua",
"make",
"php",
"python",
"rust",
"scala",
"sql",
"svelte",
"swift",
"tsx",
"typescript",
"vimdoc",
"yaml",
"zig"
},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
enable = true,
disable = function(lang, buf)
local max_filesize = 80 * 1024 -- 80 KB
if lang == "tsx" then
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
end,
-- 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 = true,
additional_vim_regex_highlighting = {"tsx"},
},
}