-- snacks.lua: Minimal UI notifications for background tasks (e.g., LSP, file ops).

return {
  "folke/snacks.nvim",
  priority = 1000,
  lazy = false,
  opts = {
    bigfile = { enabled = true },
    notifier = { enabled = true, timeout = 3000 },
    quickfile = { enabled = true },
    statuscolumn = { enabled = true },
    words = { enabled = true },
    scratch = { enabled = true, ft = "lua" },
    zen = { enabled = true },
    git = { enabled = true }, -- issue / PR / blame pickers
  },
  keys = {
    -- github
    {
      "<leader>gi",
      function()
        Snacks.picker.gh_issue({ state = "open" })
      end,
      desc = "GitHub issues (open)",
    },
    {
      "<leader>gI",
      function()
        Snacks.picker.gh_issue({ state = "all" })
      end,
      desc = "GitHub issues (all)",
    },
    {
      "<leader>gp",
      function()
        Snacks.picker.gh_pr({ state = "open" })
      end,
      desc = "GitHub PRs (open)",
    },
    {
      "<leader>gP",
      function()
        Snacks.picker.gh_pr({ state = "all" })
      end,
      desc = "GitHub PRs (all)",
    },
    -- grep / nav
    {
      "<leader>sb",
      function()
        Snacks.picker.lines()
      end,
      desc = "Buffer lines",
    },
    {
      "<leader>sB",
      function()
        Snacks.picker.grep_buffers()
      end,
      desc = "Grep open buffers",
    },
    {
      "<leader>sg",
      function()
        Snacks.picker.grep()
      end,
      desc = "Live grep",
    },
    {
      "<leader>sw",
      function()
        Snacks.picker.grep_word()
      end,
      desc = "Grep word",
    },
    {
      '<leader>s"',
      function()
        Snacks.picker.registers()
      end,
      desc = "Registers",
    },
    -- zen / scratch
    {
      "<leader>z",
      function()
        Snacks.zen()
      end,
      desc = "Zen mode",
    },
    {
      "<leader><leader>s",
      function()
        Snacks.scratch()
      end,
      desc = "Scratch buffer",
    },
  },
}
