treesitter.lua 845 B

1234567891011121314151617181920212223242526272829303132333435
  1. return {
  2. "nvim-treesitter/nvim-treesitter",
  3. build = ":TSUpdate",
  4. config = function()
  5. require("nvim-treesitter.configs").setup({
  6. ensure_installed = {
  7. "c",
  8. "lua",
  9. "typescript",
  10. "go",
  11. "vim",
  12. "vimdoc",
  13. "query",
  14. "markdown",
  15. "markdown_inline",
  16. "templ",
  17. },
  18. ignore_install = {},
  19. modules = {},
  20. sync_install = false,
  21. auto_install = false,
  22. highlight = {
  23. enable = true,
  24. disable = function(_, buf)
  25. local max_filesize = 100 * 1024
  26. local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
  27. if ok and stats and stats.size > max_filesize then
  28. return true
  29. end
  30. end,
  31. additional_vim_regex_highlighting = false,
  32. },
  33. })
  34. end,
  35. }