feat: update nvim
This commit is contained in:
parent
6a285955c8
commit
d4f2d27b3f
32 changed files with 2682 additions and 0 deletions
102
nvim/lua/plugins/snacks.lua
Normal file
102
nvim/lua/plugins/snacks.lua
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
|
||||
|
||||
bigfile = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
width = 60,
|
||||
row = nil, -- dashboard position. nil for center
|
||||
col = nil, -- dashboard position. nil for center
|
||||
pane_gap = 4, -- empty columns between vertical panes
|
||||
autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence
|
||||
-- These settings are used by some built-in sections
|
||||
preset = {
|
||||
-- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick`
|
||||
---@type fun(cmd:string, opts:table)|nil
|
||||
pick = nil,
|
||||
-- Used by the `keys` section to show keymaps.
|
||||
-- Set your custom keymaps here.
|
||||
-- When using a function, the `items` argument are the default keymaps.
|
||||
-- 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 = "L", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
|
||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||
},
|
||||
-- Used by the `header` section
|
||||
header = [[
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⡴⠶⠶⠒⠒⠒⠶⠶⣦⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⣠⡶⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⢷⣦⡀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⣠⠞⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣦⡀⠀⠀⠀
|
||||
⠀⠀⣼⠋⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣶⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣆⠀⠀
|
||||
⠀⣼⠃⠀⠀⠀⠀⠀⢀⣤⣾⡿⠟⠉⠀⠈⠙⠿⣷⣤⡀⠀⠀⠀⠀⠀⠈⢻⣆⠀
|
||||
⢸⡇⠀⠀⠀⠀⠀⣠⣿⡿⠋⠁⠒⠠⡀⠀⢀⠔⠚⠻⣿⣦⠀⠀⠀⠀⠀⠈⢿⡆
|
||||
⣼⠀⠀⠀⠀⠀⢠⣿⣿⠁⠀⠀⠀⠀⠘⡶⠁⠀⠀⠀⠸⣿⣷⡀⠀⠀⠀⠀⢸⣧
|
||||
⢿⠀⠀⠀⠀⠀⢸⢻⣿⠀⠀⠀⠙⠀⢠⢇⠀⠘⠁⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⣿
|
||||
⢸⡇⠀⠀⠀⠀⢸⠘⣿⣆⠀⠀⢀⠔⠁⠈⢦⡀⠀⠀⣸⣿⡟⡇⠀⠀⠀⠀⢠⡏
|
||||
⠈⢿⡄⠀⠀⠀⠀⢆⠈⠻⣿⣏⡀⠀⠀⠀⠀⠉⣳⣾⡿⠟⡰⠁⠀⠀⠀⠀⣼⠃
|
||||
⠀⠘⢿⣄⠀⠀⠀⠀⠣⡀⠈⠛⠿⢦⣄⣤⠶⠿⠛⠉⣀⠜⠁⠀⠀⠀⠀⣼⠏⠀
|
||||
⠀⠀⠈⠻⣦⣀⠀⠀⠀⠈⠑⠢⠤⢤⣯⣧⠤⠤⠔⠋⠁⠀⠀⠀⠀⣠⡾⠃⠀⠀
|
||||
⠀⠀⠀⢀⡼⠛⠷⣄⡀⠀⠀⠀⠀⡼⠀⢸⠀⠀⠀⠀⠀⠀⢀⣤⣾⡋⠀⠀⠀⠀
|
||||
⠀⠀⢠⠞⠀⠀⠀⠈⠉⠓⠶⣤⣄⣀⣀⣈⣀⣀⣤⠤⠶⠚⠉⠁⠀⠹⣆⠀⠀⠀
|
||||
⠀⢠⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⡆⠀⠀
|
||||
⠀⣞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⠀⠀
|
||||
⣼⠉⠉⠉⠑⡆⠀⠀⠀⠀⠀⠀⠀⠀⢹⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠤⠤⢼⡀⠀
|
||||
⠙⠦⠤⣴⣚⣁⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠸⣀⠀⠀⢀⡟⠀
|
||||
⠀⠀⠀⠀⣿⠀⣈⣉⣉⣀⡀⠀⠀⠒⠛⠒⠒⠒⠒⠒⠒⠒⠒⠒⡏⠉⠉⠁⠀⠀
|
||||
⠀⠀⠠⠾⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠶⠶⢷⣤⠀⠀]],
|
||||
},
|
||||
-- item field formatters
|
||||
formats = {
|
||||
icon = function(item)
|
||||
if item.file and item.icon == "file" or item.icon == "directory" then
|
||||
return Snacks.dashboard.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
|
||||
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 },
|
||||
},
|
||||
debug = false,
|
||||
},
|
||||
explorer = { enabled = false },
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
quickfile = { enabled = true },
|
||||
scope = { enabled = true },
|
||||
scroll = { enabled = true },
|
||||
statuscolumn = { enabled = true },
|
||||
words = { enabled = true },
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue