/ plugins / treesitter / configuration.lua
configuration.lua
 1  local parser_install_dir = vim.fn.stdpath("cache") .. "/treesitters"
 2  vim.fn.mkdir(parser_install_dir, "p")
 3  
 4  local new_runtimepath = vim.opt.runtimepath:get()
 5  table.insert(new_runtimepath, 1, parser_install_dir)
 6  vim.opt.runtimepath = new_runtimepath
 7  
 8  require("nvim-treesitter.configs").setup({
 9    ensure_installed = {
10      "agda",
11      "bash",
12      "beancount",
13      "c",
14      "cmake",
15      "comment",
16      "cpp",
17      "css",
18      "csv",
19      "dockerfile",
20      "elixir",
21      "erlang",
22      "git_config",
23      "git_rebase",
24      "gitattributes",
25      "gitcommit",
26      "gitignore",
27      "go",
28      "gomod",
29      "gosum",
30      "html",
31      "hyprlang",
32      "json",
33      "latex",
34      "llvm",
35      "lua",
36      "luau",
37      "markdown",
38      "markdown_inline",
39      "mermaid",
40      "nix",
41      "python",
42      "ruby",
43      "rust",
44      "sql",
45      "ssh_config",
46      "toml",
47      "vim",
48      "vimdoc",
49      "yaml",
50      "zig",
51    },
52    sync_install = false,
53    auto_install = true,
54    highlight = { enable = true },
55    endwise = { enable = true },
56    indent = { enable = true },
57    parser_install_dir = parser_install_dir,
58  })
59  
60  -- Enable folding using treesitter
61  vim.opt.foldmethod = "expr"
62  vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
63  vim.opt.foldenable = false