local W=204800 local function d(d,U)return(require("\095\046\117\116\105\108\115")).get_buf_file_size(U)>=1024*W end local U={"\110\118\105\109-\116\114\101\101\115\105\116\116\101\114\047\110\118\105\109-\116\114\101\101\115\105\116\116\101\114",build=function()((require("\110\118\105\109-\116\114\101\101\115\105\116\116\101\114\046\105\110\115\116\097\108\108")).update({with_sync=true}))()end,main="\110\118\105\109-\116\114\101\101\115\105\116\116\101\114\046\099\111\110\102\105\103\115";opts={ensure_installed={"\098\097\115\104";"\099\115\115","\100\105\102\102";"\101\100\105\116\111\114\099\111\110\102\105\103","\102\105\115\104";"\103\105\116\095\099\111\110\102\105\103";"\103\105\116\095\114\101\098\097\115\101";"\103\105\116\097\116\116\114\105\098\117\116\101\115","\103\105\116\099\111\109\109\105\116","\103\105\116\105\103\110\111\114\101","\103\111","\103\111\109\111\100";"\103\111\115\117\109";"\104\116\109\108";"\105\110\105";"\106\097\118\097\115\099\114\105\112\116","\106\115\111\110";"\106\117\115\116","\107\100\108","\108\117\097";"\109\097\107\101","\109\097\114\107\100\111\119\110";"\109\097\114\107\100\111\119\110\095\105\110\108\105\110\101";"\112\121\116\104\111\110";"\114\101\113\117\105\114\101\109\101\110\116\115","\115\115\104\095\099\111\110\102\105\103";"\116\111\109\108","\120\109\108";"\121\097\109\108"};sync_install=true,auto_install=true;highlight={enable=true};matchup={enable=true,disable=d},indent={enable=true,disable=d},textobjects={select={enable=true;disable=d,lookahead=true,keymaps={af="\064\102\117\110\099\116\105\111\110\046\111\117\116\101\114";["\105\102"]="\064\102\117\110\099\116\105\111\110\046\105\110\110\101\114";ac="\064\099\108\097\115\115\046\111\117\116\101\114",ic="\064\099\108\097\115\115\046\105\110\110\101\114",ia="\064\112\097\114\097\109\101\116\101\114\046\105\110\110\101\114",aa="\064\112\097\114\097\109\101\116\101\114\046\111\117\116\101\114",ab="\064\098\108\111\099\107\046\111\117\116\101\114";ib="\064\098\108\111\099\107\046\105\110\110\101\114"}}}}}local O={"\102\111\108\107\101\047\116\115-\099\111\109\109\101\110\116\115\046\110\118\105\109",dependencies={"\110\118\105\109-\116\114\101\101\115\105\116\116\101\114\047\110\118\105\109-\116\114\101\101\115\105\116\116\101\114"},event={"\086\101\114\121\076\097\122\121"};opts={}}return{U;O}
-- treesitter configuration
-- https://github.com/nvim-treesitter/nvim-treesitter

local max_file_size_kb = 200 * 1024

local function disable_on_max_filesize(_, bufnr)
  return require("_.utils").get_buf_file_size(bufnr) >= 1024 * max_file_size_kb
end

local treesitter_config = {
  "nvim-treesitter/nvim-treesitter",
  build = function()
    require("nvim-treesitter.install").update({ with_sync = true })()
  end,

  main = "nvim-treesitter.configs",
  opts = {
    ensure_installed = {
      "bash",
      "css",
      "diff",
      "editorconfig",
      "fish",
      "git_config",
      "git_rebase",
      "gitattributes",
      "gitcommit",
      "gitignore",
      "go",
      "gomod",
      "gosum",
      "html",
      "ini",
      "javascript",
      "json",
      "just",
      "kdl",
      "lua",
      "make",
      "markdown", -- required for code-companion and markview
      "markdown_inline", -- required for markview
      "python",
      "requirements",
      "ssh_config",
      "toml",
      "xml",
      "yaml",
    },
    sync_install = true,
    auto_install = true,

    -- :h nvim-treesitter-highlight-mod
    highlight = {
      enable = true,
    },

    -- see matchup.lua
    -- https://github.com/andymass/vim-matchup
    matchup = {
      enable = true,
      disable = disable_on_max_filesize,
    },

    -- :h nvim-treesitter-indentation-mod
    indent = {
      enable = true,
      disable = disable_on_max_filesize,
    },

    -- nvim-treesitter-textobjects
    -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects
    textobjects = {
      select = {
        enable = true,
        disable = disable_on_max_filesize,

        lookahead = true,
        keymaps = {
          ["af"] = "@function.outer",
          ["if"] = "@function.inner",
          ["ac"] = "@class.outer",
          ["ic"] = "@class.inner",
          ["ia"] = "@parameter.inner",
          ["aa"] = "@parameter.outer",
          ["ab"] = "@block.outer",
          ["ib"] = "@block.inner",
        },
      },
    },
  },
}

local commentstring_config = {
  "folke/ts-comments.nvim",
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
  },
  event = { "VeryLazy" },

  opts = {},
}

return {
  treesitter_config,
  commentstring_config,
}
