return { -- HACK: docs @ https://github.com/folke/snacks.nvim/blob/main/docs { "folke/snacks.nvim", priority = 1000, lazy = false, -- NOTE: Options opts = { styles = { input = { keys = { n_esc = { "", { "cmp_close", "cancel" }, mode = "n", expr = true }, i_esc = { "", { "cmp_close", "stopinsert" }, mode = "i", expr = true }, }, } }, -- Snacks Modules input = { enabled = true, }, quickfile = { enabled = true, exclude = { "latex" }, }, -- HACK: read picker docs @ https://github.com/folke/snacks.nvim/blob/main/docs/picker.md picker = { enabled = true, matchers = { frecency = true, cwd_bonus = false, }, exclude = { ".git", "node_modules", "dist", "build", }, formatters = { file = { filename_first = true, filename_only = false, icon_width = 2, }, }, layout = { -- presets options : "default" , "ivy" , "ivy-split" , "telescope" , "vscode", "select" , "sidebar" -- override picker layout in keymaps function as a param below preset = "telescope", -- defaults to this layout unless overidden cycle = false, }, layouts = { select = { preview = false, layout = { backdrop = false, width = 0.6, min_width = 80, height = 0.4, min_height = 10, box = "vertical", border = "rounded", title = "{title}", title_pos = "center", { win = "input", height = 1, border = "bottom" }, { win = "list", border = "none" }, { win = "preview", title = "{preview}", width = 0.6, height = 0.4, border = "top" }, } }, telescope = { reverse = true, -- set to false for search bar to be on top layout = { box = "horizontal", backdrop = false, width = 0.8, height = 0.9, border = "none", { box = "vertical", { win = "list", title = " Results ", title_pos = "center", border = "rounded" }, { win = "input", height = 1, border = "rounded", title = "{title} {live} {flags}", title_pos = "center" }, }, { win = "preview", title = "{preview:Preview}", width = 0.50, border = "rounded", title_pos = "center", }, }, }, ivy = { layout = { box = "vertical", backdrop = false, width = 0, height = 0.4, position = "bottom", border = "top", title = " {title} {live} {flags}", title_pos = "left", { win = "input", height = 1, border = "bottom" }, { box = "horizontal", { win = "list", border = "none" }, { win = "preview", title = "{preview}", width = 0.5, border = "left" }, }, }, }, } }, image = { enabled = function() return vim.bo.filetype == "markdown" end, doc = { float = false, -- show image on cursor hover inline = true, -- show image inline max_width = 50, max_height = 30, wo = { wrap = true, }, }, convert = { notify = true, command = "magick" }, img_dirs = { "img", "images", "assets", "static", "public", "media", "attachments","/home/sauce/Documents/Alibaba/Images", "~/Library", "~/Downloads" }, }, dashboard = { enabled = true, sections = { { section = "header" }, { section = "keys", gap = 1, padding = 1 }, { section = "startup" }, { section = "terminal", cmd = "ascii-image-converter ~/Pictures/imagesForLinux/Pfp.png -C -c", random = 15, pane = 2, indent = 15, height = 30, }, }, }, }, keys = { { "lg", function() require("snacks").lazygit() end, desc = "Lazygit" }, { "gl", function() require("snacks").lazygit.log() end, desc = "Lazygit Logs" }, -- { "es", function() require("snacks").explorer() end, desc = "Open Snacks Explorer" }, { "rN", function() require("snacks").rename.rename_file() end, desc = "Fast Rename Current File" }, { "dB", function() require("snacks").bufdelete() end, desc = "Delete or Close Buffer (Confirm)" }, -- Snacks Picker { "pf", function() require("snacks").picker.files() end, desc = "Find Files (Snacks Picker)" }, { "pc", function() require("snacks").picker.files({cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" }, { "ps", function() require("snacks").picker.grep() end, desc = "Grep word" }, { "pws", function() require("snacks").picker.grep_word() end, desc = "Search Visual Selection or Word", mode = {"n", "x" } }, { "pk", function() require("snacks").picker.keymaps({ layout = "ivy" }) end, desc = "Search Keymaps (Snacks Picker)" }, { "gbr", function() require("snacks").picker.git_branches({ layout = "select" }) end, desc = "Pick and Switch Git Branches" }, { "th", function() require("snacks").picker.colorschemes({ layout = "ivy" }) end, desc = "Pick Color Schemes"}, { "vh", function() require("snacks").picker.help() end, desc = "Help Pages" }, } }, { "folke/todo-comments.nvim", event = { "BufReadPre", "BufNewFile"}, keys = { { "pt", function() require("snacks").picker.todo_comments() end, desc = "Todo" }, { "pT", function() require("snacks").picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, } }, }