explorer:设置宽度。

This commit is contained in:
2025-11-27 15:25:35 +08:00
parent 4ce5a8e226
commit de1e773d79
2 changed files with 41 additions and 0 deletions

40
lua/plugins/snacks.lua Normal file
View File

@@ -0,0 +1,40 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true},
indent = { enabled = true },
input = { enabled = true },
picker = {
enabled = true,
sources = {
explorer = {
layout = function()
return {
preset = "sidebar",
preview = false,
layout = {
width = (vim.g.explorer_size or {}).width or 32, -- 默认40
},
}
end,
on_close = function(picker)
vim.g.explorer_size = picker.layout.root:size() -- 关闭时保存尺寸
end,
},
},
},
notifier = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = true },
statuscolumn = { enabled = true },
words = { enabled = true },
},
}