diff --git a/lua/layouts/modified_presets.lua b/lua/layouts/modified_presets.lua new file mode 100644 index 0000000..2433002 --- /dev/null +++ b/lua/layouts/modified_presets.lua @@ -0,0 +1,46 @@ +local layouts = { + telescope = { + reverse = true, + layout = { + box = "horizontal", + backdrop = 90, + 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}", title_pos = "left" }, + }, + { + win = "preview", + title = "{preview:Preview}", + width = 0.6, + border = "rounded", + title_pos = "center", + }, + }, + }, + sidebar = { + preview = "main", + layout = { + backdrop = false, + width = 40, + min_width = 40, + height = 0, + position = "left", + border = "none", + box = "vertical", + { + win = "input", + height = 1, + border = "rounded", + title = "{title}", + title_pos = "center", + }, + { win = "list", border = "none" }, + { win = "preview", title = "{preview}", height = 0.4, border = "top" }, + }, + }, +} +return layouts diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index f2d88ed..7a68441 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -1,11 +1,15 @@ +local my_presets = require("layouts.modified_presets") return { "folke/snacks.nvim", + priority = 1000, + lazy = false, opts = { - -- + ----------------------------------------------- -- notifications - -- + ----------------------------------------------- + notifier = { - border = "rounded", + border = "none", zindex = 100, ft = "markdown", style = "fancy", @@ -17,13 +21,29 @@ return { }, bo = { filetype = "snacks_notif" }, }, - -- - -- animations - -- - animate = { }, - -- - -- dashboard - -- + + ----------------------------------------------- + -- picker + ----------------------------------------------- + picker = { + cycle = false, + layouts = my_presets, + layout = { preset = "telescope", auto_hide = { "input" } }, + finder = "files", + format = "file", + show_empty = true, + hidden = true, + ignored = true, + follow = true, + supports_live = true, + sources = { + explorer = { matcher = { fuzzy = true }, layout = { preset = "sidebar" } }, + buffers = { layout = { preset = "vscode" } }, + }, + }, + + ----------------------------------------------- + dashboard = { preset = { header = [[ @@ -55,4 +75,28 @@ return { }, }, }, + + ----------------------------------------------- + -- keys + ----------------------------------------------- + + -- exploerer + keys = { + { + "fe", + function() + Snacks.explorer({ cwd = LazyVim.root() }) + end, + desc = "Explorer Snacks (root dir)", + }, + { + "fE", + function() + Snacks.explorer() + end, + desc = "Explorer Snacks (cwd)", + }, + { "e", "fe", desc = "Explorer Snacks (root dir)", remap = true }, + { "E", "fE", desc = "Explorer Snacks (cwd)", remap = true }, + }, }