This commit is contained in:
Zelong Kuang
2025-10-11 17:18:56 +11:00
parent 88d39a1595
commit 9b8a7b07a1
7 changed files with 343 additions and 35 deletions

View File

@@ -0,0 +1,71 @@
return {
{
"folke/snacks.nvim",
opts = {
-- image = {},
indent = {
chunk = {
enabled = true,
priority = 200,
hl = "SnacksIndentChunk", ---@type string|string[] hl group for chunk scopes
char = {
-- corner_top = "┌",
-- corner_bottom = "└",
corner_top = "",
corner_bottom = "",
horizontal = "",
vertical = "",
arrow = ">",
},
},
},
dashboard = {
preset = {
-- stylua: ignore
---@type snacks.dashboard.Item[]
keys = {
{ icon = "", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
{ icon = "", key = "n", desc = "New File", action = ":ene | startinsert" },
-- { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
{ icon = "", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
{ icon = "", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
{ icon = "", key = "d", desc = "Dotfiles", action = ":lua Snacks.picker.files({cwd = vim.fn.expand('~/.config'),hidden=true})" },
{ icon = "", key = "s", desc = "Restore Session", section = "session" },
{ icon = "", key = "x", desc = "Lazy Extras", action = ":LazyExtras" },
{ icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" },
{ icon = "", key = "q", desc = "Quit", action = ":qa" },
},
header = [[
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
},
sections = {
-- { section = "terminal", cmd = "fortune -s | cowsay", hl = "header", padding = 1, indent = 8 },
{ section = "header" },
{ title = "Projects", padding = 1 },
{ section = "projects", padding = 1, gap = 1 },
{ title = "Options", padding = 1 },
{ section = "keys", gap = 1 },
},
},
picker = {
matcher = {
frecency = true,
},
-- debug = {
-- scores = true,
-- },
},
},
-- stylua: ignore
keys = {
{ "<c-/>", function() Snacks.terminal(nil, { cwd = vim.fn.expand("%:p:h") }) end, desc = "Toggle Terminal" },
{ "]]", function() Snacks.words.jump(vim.v.count1) end, desc = "Next Reference", mode = { "n", "t" } },
{ "[[", function() Snacks.words.jump(-vim.v.count1) end, desc = "Prev Reference", mode = { "n", "t" } },
},
},
}