nvim/.config/nvim/lua/plugins/treesitter/core.lua

-- nvim/.config/nvim/lua/plugins/treesitter/core.lua

return {
  "nvim-treesitter/nvim-treesitter",
  version = false,
  build = ":TSUpdate",
  event = { "BufReadPost", "BufNewFile" },
  cmd = { "TSUpdate", "TSInstall", "TSInstallInfo" },
  keys = {
    { "<c-space>", desc = "init selection" },
    { "<bs>",      desc = "shrink selection", mode = "x" },
  },
  opts = {
    highlight = { enable = true, additional_vim_regex_highlighting = false },
    indent    = { enable = true, disable = { "python", "yaml" } },
    incremental_selection = {
      enable = true,
      keymaps = {
        init_selection    = "<C-space>",
        node_incremental  = "<C-space>",
        scope_incremental = false,
        node_decremental  = "<bs>",
      },
    },
    ensure_installed = {
      "bash", "c", "cpp", "css", "diff", "dockerfile", "fish",
      "gitcommit", "gitignore", "go", "gomod", "gosum", "html",
      "json", "jsonc", "lua", "luadoc", "luap", "make", "markdown",
      "markdown_inline", "python", "query", "regex", "rust", "toml",
      "tsx", "typescript", "vim", "vimdoc", "yaml", "zig",
    },
  },
  config = function(_, opts)
    require("nvim-treesitter.configs").setup(opts)
  end,
}