AutoYADM commit: 2024-12-04 17:50:03
This commit is contained in:
parent
0ab055d780
commit
58e517b171
1 changed files with 94 additions and 79 deletions
|
@ -1,90 +1,105 @@
|
||||||
return {
|
return {
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
priority = 1000,
|
|
||||||
lazy = false,
|
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
dashboard = {
|
dashboard = {
|
||||||
{
|
width = 60,
|
||||||
enabled = true,
|
row = nil, -- dashboard position. nil for center
|
||||||
width = 60,
|
col = nil, -- dashboard position. nil for center
|
||||||
row = nil, -- dashboard position. nil for center
|
pane_gap = 4, -- empty columns between vertical panes
|
||||||
col = nil, -- dashboard position. nil for center
|
autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence
|
||||||
pane_gap = 4, -- empty columns between vertical panes
|
-- These settings are used by some built-in sections
|
||||||
autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence
|
preset = {
|
||||||
-- These settings are used by some built-in sections
|
-- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick`
|
||||||
preset = {
|
---@type fun(cmd:string, opts:table)|nil
|
||||||
-- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick`
|
pick = nil,
|
||||||
---@type fun(cmd:string, opts:table)|nil
|
-- Used by the `keys` section to show keymaps.
|
||||||
pick = nil,
|
-- Set your custom keymaps here.
|
||||||
-- Used by the `keys` section to show keymaps.
|
-- When using a function, the `items` argument are the default keymaps.
|
||||||
-- Set your custom keymaps here.
|
---@type snacks.dashboard.Item[]
|
||||||
-- When using a function, the `items` argument are the default keymaps.
|
keys = {
|
||||||
---@type snacks.dashboard.Item[]
|
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
|
||||||
keys = {
|
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||||
{ icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
|
{ icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
|
||||||
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
{ icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
|
||||||
{ 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",
|
||||||
icon = " ",
|
desc = "Config",
|
||||||
key = "c",
|
action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
|
||||||
desc = "Config",
|
|
||||||
action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
|
|
||||||
},
|
|
||||||
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
|
||||||
{ icon = " ", key = "L", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
|
|
||||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
|
||||||
},
|
},
|
||||||
header = [[
|
{ icon = " ", key = "s", desc = "Restore Session", section = "session" },
|
||||||
_.oo.
|
{ icon = " ", key = "L", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
|
||||||
_.u[[/;:,. .odMMMMMM'
|
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||||
.o888UU[[[/;:-. .o@P^ MMM^
|
|
||||||
oN88888UU[[[/;::-. dP^
|
|
||||||
dNMMNN888UU[[[/;:--. .o@P^
|
|
||||||
,MMMMMMN888UU[[/;::-. o@^
|
|
||||||
NNMMMNN888UU[[[/~.o@P^
|
|
||||||
888888888UU[[[/o@^-..
|
|
||||||
oI8888UU[[[/o@P^:--..
|
|
||||||
.@^ YUU[[[/o@^;::---..
|
|
||||||
oMP ^/o@P^;:::---..
|
|
||||||
.dMMM .o@^ ^;::---...
|
|
||||||
dMMMMMMM@^` `^^^^
|
|
||||||
YMMMUP^
|
|
||||||
^^
|
|
||||||
]], -- Used by the `header` section
|
|
||||||
},
|
},
|
||||||
-- item field formatters
|
-- Used by the `header` section
|
||||||
formats = {
|
header = [[
|
||||||
icon = function(item)
|
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
|
||||||
if item.file and item.icon == "file" or item.icon == "directory" then
|
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
|
||||||
return M.icon(item.file, item.icon)
|
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
|
||||||
|
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
|
||||||
|
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||||
|
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
|
||||||
|
},
|
||||||
|
-- item field formatters
|
||||||
|
formats = {
|
||||||
|
icon = function(item)
|
||||||
|
if item.file and item.icon == "file" or item.icon == "directory" then
|
||||||
|
return M.icon(item.file, item.icon)
|
||||||
|
end
|
||||||
|
return { item.icon, width = 2, hl = "icon" }
|
||||||
|
end,
|
||||||
|
footer = { "%s", align = "center" },
|
||||||
|
header = { "%s", align = "center" },
|
||||||
|
file = function(item, ctx)
|
||||||
|
local fname = vim.fn.fnamemodify(item.file, ":~")
|
||||||
|
fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname
|
||||||
|
if #fname > ctx.width then
|
||||||
|
local dir = vim.fn.fnamemodify(fname, ":h")
|
||||||
|
local file = vim.fn.fnamemodify(fname, ":t")
|
||||||
|
if dir and file then
|
||||||
|
file = file:sub(-(ctx.width - #dir - 2))
|
||||||
|
fname = dir .. "/…" .. file
|
||||||
end
|
end
|
||||||
return { item.icon, width = 2, hl = "icon" }
|
end
|
||||||
end,
|
local dir, file = fname:match("^(.*)/(.+)$")
|
||||||
footer = { "%s", align = "center" },
|
return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } }
|
||||||
header = { "%s", align = "center" },
|
end,
|
||||||
file = function(item, ctx)
|
},
|
||||||
local fname = vim.fn.fnamemodify(item.file, ":~")
|
sections = {
|
||||||
fname = ctx.width and #fname > ctx.width and vim.fn.pathshorten(fname) or fname
|
{ section = "header" },
|
||||||
if #fname > ctx.width then
|
{ section = "keys", gap = 1, padding = 1 },
|
||||||
local dir = vim.fn.fnamemodify(fname, ":h")
|
{ section = "startup" },
|
||||||
local file = vim.fn.fnamemodify(fname, ":t")
|
|
||||||
if dir and file then
|
|
||||||
file = file:sub(-(ctx.width - #dir - 2))
|
|
||||||
fname = dir .. "/…" .. file
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local dir, file = fname:match("^(.*)/(.+)$")
|
|
||||||
return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } or { { fname, hl = "file" } }
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
{ section = "header" },
|
|
||||||
{ section = "keys", gap = 1, padding = 1 },
|
|
||||||
{ section = "startup" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
-- return {
|
||||||
|
-- "folke/snacks.nvim",
|
||||||
|
-- opts = {
|
||||||
|
-- dashboard = {
|
||||||
|
-- preset = {
|
||||||
|
-- header = [[
|
||||||
|
-- ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||||
|
-- ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||||
|
-- ██║ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX█╔████╔██║ z
|
||||||
|
-- ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
||||||
|
-- ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||||
|
-- ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||||
|
-- ]],
|
||||||
|
-- -- 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 = "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" },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue