-- Base plugins and libraries

return {
  "nvim-lua/plenary.nvim",
  {
    "folke/snacks.nvim",
    priority = 1000, -- needs to be set up early
    lazy = false,
    opts = {
      bigfiles = { enabled = true },
      dashboard = {
        enabled = true,
        sections = {
          { section = "header" },
          { icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 },
          { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
          {
            icon = " ",
            title = "Git Status",
            section = "terminal",
            enabled = function()
              return Snacks.git.get_root() ~= nil
            end,
            cmd = "git status --short --branch --renames",
            height = 5,
            padding = 1,
            ttl = 5 * 60,
            indent = 3,
          },
        },
        preset = { keys = {} },
      },
      indent = { enabled = true, animate = { enabled = false } },
      input = { enabled = true },
      lazygit = { enabled = true, configure = true },
      picker = { enabled = true },
      quickfile = { enabled = true },
      statuscolumn = { enabled = true },
    },
    keys = {
      {
        "<leader>gg",
        function()
          require("snacks").lazygit()
        end,
        desc = "Open LazyGit",
      },
    },
  },
  {
    "stevearc/conform.nvim",
    opts = {
      formatters_by_ft = {
        lua = { "stylua" },
      },
      format_on_save = {
        timeout_ms = 500,
        lsp_format = "fallback",
      },
    },
  },
  {
    "zapling/mason-conform.nvim",
    depends = {
      "williamboman/mason.nvim",
      "stevearc/conform.nvim",
    },
    opts = {},
  },
  {
    "mrjones2014/legendary.nvim",
    priority = 999,
    opts = {
      extensions = { lazy_nvim = true },
    },
  },
  {
    "m4xshen/autoclose.nvim",
    opts = {},
  },
  {
    "wsdjeg/rooter.nvim",
    opts = {
      root_pattern = { ".git/" },
    },
  },
}