return { "folke/snacks.nvim", dependencies = { { "echasnovski/mini.icons", version = "*" }, "stevearc/oil.nvim", "folke/trouble.nvim", }, priority = 1000, lazy = false, opts = function() -- Toggle the profiler Snacks.toggle.profiler():map("sp") -- Toggle the profiler highlights Snacks.toggle.profiler_highlights():map("sh") return { animate = { enabled = false }, bigfile = { enabled = true }, bufdelete = { enabled = true }, dashboard = { enabled = false }, debug = { enabled = true }, dim = { enabled = false }, explorer = { enabled = false }, git = { enabled = true }, gitbrowse = { enabled = true }, image = { enabled = false, doc = { inline = false, float = true, }, img_dirs = { "img", "images", "assets", "assets/img", "static", "public", "media", "attachments" }, math = { enabled = false }, }, indent = { enabled = true, animate = { enabled = false }, }, input = { enabled = false }, layout = { enabled = false }, lazygit = { enabled = false }, notifier = { enabled = false }, notify = { enabled = false }, picker = { enabled = true, format = "file", layout = { preset = "telescope", }, matcher = { frecency = true, sort_empty = true, cwd_bonus = true, }, actions = require("trouble.sources.snacks").actions, win = { input = { keys = { [""] = { "trouble_open", mode = { "n", "i" }, }, }, }, }, }, profiler = { enabled = false }, quickfile = { enabled = true, exclude = { "latex" } }, rename = { enabled = true }, scope = { enabled = false }, scratch = { enabled = false }, scroll = { enabled = false }, statuscolumn = { enabled = true, left = { "mark", "sign", "git" }, right = { "fold" }, folds = { open = true, -- show open fold icons git_hl = true, -- use Git Signs hl for fold icons }, }, terminal = { enabled = false }, toggle = { enabled = true }, win = { enabled = false }, words = { enabled = true }, zen = { enabled = false }, } end, keys = { { "Nn", function() Snacks.notifier.show_history() end, desc = "History", }, { "ss", function() Snacks.profiler.scratch() end, desc = "Profiler Scratch Bufer", }, { "gB", function() Snacks.gitbrowse() end, desc = "Git Browse", }, { "gb", function() Snacks.git.blame_line() end, desc = "Git Blame", }, { "", function() Snacks.picker.files() end, desc = "Find Files", }, { "pf", function() Snacks.picker.files() end, desc = "Find Files", }, { "ps", function() Snacks.picker.grep() end, desc = "Grep", }, { "pb", function() Snacks.picker.buffers() end, desc = "Buffers", }, { "pw", function() Snacks.picker.grep_word() end, desc = "Visual selection of word", mode = { "n", "x" }, }, { "pi", function() Snacks.picker.icons() end, desc = "Icons", }, { "ph", function() Snacks.picker.help() end, desc = "Help Pages", }, { "pr", function() Snacks.picker.recent() end, desc = "Recent", }, { "pR", function() Snacks.picker.registers() end, desc = "Registers", }, { "pg", function() Snacks.picker.git_files() end, desc = "Find Git Fiels", }, { "pk", function() Snacks.picker.keymaps() end, desc = "Keymaps", }, { "pt", function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme", }, { "pc", function() Snacks.picker.colorschemes() end, desc = "Colorschemes", }, { "pl", function() Snacks.picker.lazy() end, desc = "Search for Plugin Spec", }, { "pD", function() Snacks.picker.diagnostics() end, desc = "Diagnostics", }, }, init = function() vim.api.nvim_create_autocmd("User", { pattern = "VeryLazy", callback = function() -- Setup some globals for debugging (lazy-loaded) _G.dd = function(...) Snacks.debug.inspect(...) end _G.bt = function() Snacks.debug.backtrace() end vim.print = _G.dd -- Override print to use snacks for `:=` command end, }) vim.api.nvim_create_autocmd("User", { pattern = "OilActionsPost", callback = function(event) if event.data.actions.type == "move" then Snacks.rename.on_rename_file(event.data.actions.src_url, event.data.actions.dest_url) end end, }) end, }