Files
lazyfox/lua/plugins/snacks.lua
2025-07-25 14:20:11 +03:00

133 lines
3.4 KiB
Lua

return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = {
enabled = true,
preset = {
header = [[
██╗ █████╗ ███████╗██╗ ██╗███████╗ ██████╗ ██╗ ██╗
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██╔════╝██╔═══██╗╚██╗██╔╝
██║ ███████║ ███╔╝ ╚████╔╝ █████╗ ██║ ██║ ╚███╔╝
██║ ██╔══██║ ███╔╝ ╚██╔╝ ██╔══╝ ██║ ██║ ██╔██╗
███████╗██║ ██║███████╗ ██║ ██║ ╚██████╔╝██╔╝ ██╗
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝]],
},
},
explorer = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = {
enabled = true,
timeout = 3000,
},
picker = { enabled = true, debug = { scores = true } },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false },
statuscolumn = { enabled = true },
words = { enabled = true },
styles = {
notification = {
wo = { wrap = true }, -- Wrap notifications
},
},
},
keys = {
{
"<leader>ff",
function()
Snacks.picker.files({ layout = "ivy" })
end,
desc = "Find Files",
},
{
"<M-k>",
function()
Snacks.picker.keymaps({ layout = "vertical" })
end,
desc = "Dashboard",
},
{
"<S-b>",
function()
Snacks.picker.buffers({
on_show = function()
vim.cmd.stopinsert()
end,
finder = "buffers",
format = "buffer",
hidden = false,
unloaded = true,
current = true,
sort_lastused = true,
win = {
input = {
keys = {
["d"] = "bufdelete",
},
},
list = { keys = { ["d"] = "bufdelete" } },
},
layout = "ivy",
})
end,
desc = "[P]Snacks picker buffers",
},
-- LSP
{
"gd",
function()
Snacks.picker.lsp_definitions()
end,
desc = "Goto Definition",
},
{
"gD",
function()
Snacks.picker.lsp_declarations()
end,
desc = "Goto Declaration",
},
{
"gr",
function()
Snacks.picker.lsp_references()
end,
nowait = true,
desc = "References",
},
{
"gI",
function()
Snacks.picker.lsp_implementations()
end,
desc = "Goto Implementation",
},
{
"gy",
function()
Snacks.picker.lsp_type_definitions()
end,
desc = "Goto T[y]pe Definition",
},
{
"<leader>ss",
function()
Snacks.picker.lsp_symbols()
end,
desc = "LSP Symbols",
},
{
"<leader>sS",
function()
Snacks.picker.lsp_workspace_symbols()
end,
desc = "LSP Workspace Symbols",
},
},
}