return{{"\110\118\105\109-\116\114\101\101\115\105\116\116\101\114",after=function()(require("\110\118\105\109-\116\114\101\101\115\105\116\116\101\114\046\099\111\110\102\105\103\115")).setup({auto_install=false,highlight={enable=true,additional_vim_regex_highlighting=false};rainbow={enable=true,extended_mode=true,max_file_lines=8192}})vim.o.foldmethod="\101\120\112\114"vim.o.foldexpr="\110\118\105\109\095\116\114\101\101\115\105\116\116\101\114\035\102\111\108\100\101\120\112\114\040\041"vim.o.foldenable=false vim.api.nvim_del_user_command("\084\083\085\112\100\097\116\101")vim.api.nvim_del_user_command("\084\083\085\112\100\097\116\101\083\121\110\099")vim.api.nvim_del_user_command("\084\083\073\110\115\116\097\108\108")vim.api.nvim_del_user_command("\084\083\073\110\115\116\097\108\108\083\121\110\099")vim.api.nvim_del_user_command("\084\083\073\110\115\116\097\108\108\070\114\111\109\071\114\097\109\109\097\114")vim.api.nvim_del_user_command("\084\083\085\110\105\110\115\116\097\108\108")end};{"\110\101\111\103\101\110";event="\066\117\102\065\100\100";after=function()(require("\110\101\111\103\101\110")).setup({})local function O(O,...)local V={...}return function()pcall(O,unpack(V))end end local V=(require("\107\101\121\109\097\112\115")).setup();(require("\119\104\105\099\104-\107\101\121")).add({"\060\108\111\099\097\108\108\101\097\100\101\114\062\097";group="\097\110\110\111\116\097\116\101"})V.normal["\060\108\111\099\097\108\108\101\097\100\101\114\062\097\102"]={O((require("\110\101\111\103\101\110")).generate,{type="\102\117\110\099"});"\091\102\117\110\099\093 \099\114\101\097\116\101 \097\110\110\111\116\097\116\105\111\110"}V.normal["\060\108\111\099\097\108\108\101\097\100\101\114\062\097\099"]={O((require("\110\101\111\103\101\110")).generate,{type="\099\108\097\115\115"}),"\091\099\108\097\115\115\093 \099\114\101\097\116\101 \097\110\110\111\116\097\116\105\111\110"}V.normal["\060\108\111\099\097\108\108\101\097\100\101\114\062\097\116"]={O((require("\110\101\111\103\101\110")).generate,{type="\116\121\112\101"}),"\091\116\121\112\101\093 \099\114\101\097\116\101 \097\110\110\111\116\097\116\105\111\110"}V.normal["\060\108\111\099\097\108\108\101\097\100\101\114\062\097\070"]={O((require("\110\101\111\103\101\110")).generate,{type="\102\105\108\101"}),"\091\070\105\108\101\093 \099\114\101\097\116\101 \097\110\110\111\116\097\116\105\111\110"}end},{"\116\114\101\101\119\097\108\107\101\114\046\110\118\105\109";event="\066\117\102\065\100\100";after=function()(require("\116\114\101\101\119\097\108\107\101\114")).setup({highlight=true,highlight_duration=250,highlight_group="\067\117\114\115\111\114\076\105\110\101"})local function O(O,V)return function()pcall(O,V)end end local V=(require("\107\101\121\109\097\112\115")).setup()V.visual["\060\109-\106\062"]={O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \068\111\119\110")}V.visual["\060\109-\107\062"]={O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \085\112")}V.visual["\060\109-\108\062"]={O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \082\105\103\104\116")}V.visual["\060\109-\104\062"]={O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \076\101\102\116")}local G=vim.api.nvim_create_namespace("\116\114\101\101\119\097\108\107\101\114-\109\111\100\101")V.normal["\060\108\101\097\100\101\114\062\060\109-\116\062"]={function()vim.on_key(function(V,L)local U={h=O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \076\101\102\116");j=O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \068\111\119\110");k=O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \085\112");l=O(vim.cmd,"\084\114\101\101\119\097\108\107\101\114 \082\105\103\104\116")}local o=vim.fn.keytrans(L)if o=="\060\069\115\099\062"then vim.on_key(nil,G)elseif vim.tbl_contains(vim.tbl_keys(U),o)then local O=U[o]if O and type(O)=="\102\117\110\099\116\105\111\110"then O()end end return""end,G)end;"\101\110\116\101\114 \116\114\101\101\119\097\108\107\101\114 \109\111\100\101"}end}}
return {
  {
    "nvim-treesitter",
    after = function()
      ---@diagnostic disable: missing-fields
      require("nvim-treesitter.configs").setup({
        auto_install = false,
        highlight = {
          enable = true,
          additional_vim_regex_highlighting = false,
        },
        rainbow = {
          enable = true,
          extended_mode = true,
          max_file_lines = 8192,
        },
      })

      vim.o.foldmethod = "expr"
      vim.o.foldexpr = "nvim_treesitter#foldexpr()"
      vim.o.foldenable = false

      -- remove treesitter commands
      vim.api.nvim_del_user_command("TSUpdate")
      vim.api.nvim_del_user_command("TSUpdateSync")
      vim.api.nvim_del_user_command("TSInstall")
      vim.api.nvim_del_user_command("TSInstallSync")
      vim.api.nvim_del_user_command("TSInstallFromGrammar")
      vim.api.nvim_del_user_command("TSUninstall")
    end,
  },

  {
    "neogen",
    event = "BufAdd",
    after = function()
      require("neogen").setup({})

      local function cbcall(fn, ...)
        local props = { ... }
        return function()
          pcall(fn, unpack(props))
        end
      end
      local keymaps = require("keymaps").setup()
      require("which-key").add({ "<localleader>a", group = "annotate" })
      keymaps.normal["<localleader>af"] = {
        cbcall(require("neogen").generate, { type = "func" }),
        "[func] create annotation",
      }
      keymaps.normal["<localleader>ac"] = {
        cbcall(require("neogen").generate, { type = "class" }),
        "[class] create annotation",
      }
      keymaps.normal["<localleader>at"] = {
        cbcall(require("neogen").generate, { type = "type" }),
        "[type] create annotation",
      }
      keymaps.normal["<localleader>aF"] = {
        cbcall(require("neogen").generate, { type = "file" }),
        "[File] create annotation",
      }
    end,
  },

  {
    "treewalker.nvim",
    event = "BufAdd",
    after = function()
      require("treewalker").setup({
        -- briefly highlight the node after jumping to it
        highlight = true,
        highlight_duration = 250,
        highlight_group = "CursorLine",
      })

      local function cbcall(fn, props)
        return function()
          pcall(fn, props)
        end
      end
      local keymaps = require("keymaps").setup()
      keymaps.visual["<m-j>"] = { cbcall(vim.cmd, [[Treewalker Down]]) }
      keymaps.visual["<m-k>"] = { cbcall(vim.cmd, [[Treewalker Up]]) }
      keymaps.visual["<m-l>"] = { cbcall(vim.cmd, [[Treewalker Right]]) }
      keymaps.visual["<m-h>"] = { cbcall(vim.cmd, [[Treewalker Left]]) }

      local ns = vim.api.nvim_create_namespace("treewalker-mode")
      keymaps.normal["<leader><m-t>"] = {
        function()
          vim.on_key(function(key, typed)
            local switch = {
              ["h"] = cbcall(vim.cmd, [[Treewalker Left]]),
              ["j"] = cbcall(vim.cmd, [[Treewalker Down]]),
              ["k"] = cbcall(vim.cmd, [[Treewalker Up]]),
              ["l"] = cbcall(vim.cmd, [[Treewalker Right]]),
            }

            local k = vim.fn.keytrans(typed)
            if k == "<Esc>" then
              vim.on_key(nil, ns)
            elseif vim.tbl_contains(vim.tbl_keys(switch), k) then
              local fn = switch[k]
              if fn and type(fn) == "function" then
                fn()
              end
            end
            return ""
          end, ns)
        end,
        "enter treewalker mode",
      }
    end,
  },
}
