-- lazy.nvim
{
"folke/snacks.nvim",
---@type snacks.Config
opts = {
layout = {
-- your layout configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
}
}
---@class snacks.layout.Config
---@field show? boolean show the layout on creation (default: true)
---@field wins table<string, snacks.win> windows to include in the layout
---@field layout snacks.layout.Box layout definition
---@field fullscreen? boolean open in fullscreen
---@field hidden? string[] list of windows that will be excluded from the layout (but can be toggled)
---@field on_update? fun(layout: snacks.layout)
{
layout = {
width = 0.6,
height = 0.6,
zindex = 50,
},
}
---@class snacks.layout.Win: snacks.win.Config,{}
---@field depth? number
---@field win string layout window name
---@class snacks.layout.Box: snacks.layout.Win,{}
---@field box "horizontal" | "vertical"
---@field id? number
---@field [number] snacks.layout.Win | snacks.layout.Box children
---@alias snacks.layout.Widget snacks.layout.Win | snacks.layout.Box
---@class snacks.layout
---@field opts snacks.layout.Config
---@field root snacks.win
---@field wins table<string, snacks.win|{enabled?:boolean}>
---@field box_wins snacks.win[]
---@field win_opts table<string, snacks.win.Config>
---@field closed? boolean
---@field split? boolean
---@field screenpos number[]?
Snacks.layout = {}
---@param opts snacks.layout.Config
Snacks.layout.new(opts)
Close the layout
---@param opts? {wins?: boolean}
layout:close(opts)
---@param cb fun(widget: snacks.layout.Widget, parent?: snacks.layout.Box)
---@param opts? {wins?:boolean, boxes?:boolean, box?:snacks.layout.Box}
layout:each(cb, opts)
layout:hide()
Check if the window has been used in the layout
---@param w string
layout:is_enabled(w)
layout:is_hidden()
Check if a window is hidden
---@param win string
layout:is_hidden(win)
Toggle fullscreen
layout:maximize()
Show the layout
layout:show()
Toggle a window
---@param win string
layout:toggle(win)
layout:unhide()
Check if layout is valid (visible)
layout:valid()