Xinqi Bao's Git

refactor(tmux): reorganize config and enable mouse support
[dotfiles.git] / .config / nvim / lua / plugin-config / nvim-treesitter.lua
1 require'nvim-treesitter'.setup {
2 -- A list of parser names, or "all"
3 ensure_installed = { "c", "lua", "vim", "vimdoc", "query" },
4
5 -- Automatically install missing parsers when entering buffer
6 -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
7 auto_install = true,
8
9 highlight = {
10 enable = true,
11
12 -- to disable slow treesitter highlight for large files
13 disable = function(lang, buf)
14 local max_filesize = 100 * 1024 -- 100 KB
15 local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
16 if ok and stats and stats.size > max_filesize then
17 return true
18 end
19 end,
20 additional_vim_regex_highlighting = false,
21 },
22 }