### Edgy.nvim Example Setup Source: https://github.com/folke/edgy.nvim/blob/main/doc/edgy.nvim.txt Configure edgy.nvim to manage various window types like toggleterm, lazyterm, Trouble, QuickFix, and help windows at the bottom. It also sets up Neo-tree, SymbolsOutline, and other windows on the left side, with options for filtering and custom sizing. ```lua { "folke/edgy.nvim", event = "VeryLazy", init = function() vim.opt.laststatus = 3 vim.opt.splitkeep = "screen" end, opts = { bottom = { -- toggleterm / lazyterm at the bottom with a height of 40% of the screen { ft = "toggleterm", size = { height = 0.4 }, -- exclude floating windows filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == "" end, }, { ft = "lazyterm", title = "LazyTerm", size = { height = 0.4 }, filter = function(buf) return not vim.b[buf].lazyterm_cmd end, }, "Trouble", { ft = "qf", title = "QuickFix" }, { ft = "help", size = { height = 20 }, -- only show help buffers filter = function(buf) return vim.bo[buf].buftype == "help" end, }, { ft = "spectre_panel", size = { height = 0.4 } }, }, left = { -- Neo-tree filesystem always takes half the screen height { title = "Neo-Tree", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, size = { height = 0.5 }, }, { title = "Neo-Tree Git", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "git_status" end, pinned = true, collapsed = true, -- show window as closed/collapsed on start open = "Neotree position=right git_status", }, { title = "Neo-Tree Buffers", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "buffers" end, pinned = true, collapsed = true, -- show window as closed/collapsed on start open = "Neotree position=top buffers", }, { title = function() local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]" return vim.fn.fnamemodify(buf_name, ":t") end, ft = "Outline", pinned = true, open = "SymbolsOutlineOpen", }, -- any other neo-tree windows "neo-tree", }, }, } ``` -------------------------------- ### Setup edgy.nvim manually Source: https://github.com/folke/edgy.nvim/blob/main/README.md If not using lazy.nvim, call the setup function with optional configuration. ```lua require("edgy").setup(opts?) ``` -------------------------------- ### Install edgy.nvim with lazy.nvim Source: https://github.com/folke/edgy.nvim/blob/main/README.md Use this snippet to install edgy.nvim using the lazy.nvim package manager. Ensure the 'VeryLazy' event is used for optimal loading. ```lua { "folke/edgy.nvim", event = "VeryLazy", opts = {} } ``` -------------------------------- ### setup Source: https://context7.com/folke/edgy.nvim/llms.txt Initializes edgy.nvim with a layout configuration. This function should be called once during Neovim startup to register window layouts and define how different filetypes are managed in edgebars. ```APIDOC ## `require("edgy").setup(opts)` — Initialize edgy.nvim with a layout configuration The entry point for edgy.nvim. Call this once during Neovim startup to register your window layout. Each position (`left`, `right`, `top`, `bottom`) accepts a list of view definitions. Views are matched by `ft` (filetype) and optionally filtered. Global and per-view window options, animation settings, keymaps, and icons are all configured here. ### Parameters - **opts** (table) - Configuration options for edgy.nvim. - **left** (table | list) - Configuration for the left edgebar. Accepts a list of view definitions or shorthand filetype strings. - **right** (table | list) - Configuration for the right edgebar. - **top** (table | list) - Configuration for the top edgebar. - **bottom** (table | list) - Configuration for the bottom edgebar. - **options** (table) - Default size options for each position (e.g., `left = { size = 40 }`). - **animate** (table) - Animation settings, including `enabled`, `fps`, `cps`, `on_begin`, `on_end`, and `spinner`. - **exit_when_last** (boolean) - If true, exits Neovim when only edgy windows remain. - **close_when_all_hidden** (boolean) - If true, closes the edgebar when all its windows are hidden. - **wo** (table) - Global window-local options applied to all edgebar windows. - **keys** (table) - Custom buffer-local keymaps for edgebar windows. - **icons** (table) - Icons for open and closed states of edgebar elements. ### Request Example ```lua -- Recommended Neovim options (set before or alongside setup) vim.opt.laststatus = 3 -- required for fully collapsible windows vim.opt.splitkeep = "screen" -- prevents main splits from jumping require("edgy").setup({ -- Windows matching these filetypes go to the left edgebar left = { { title = "Neo-Tree", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, size = { height = 0.5 }, -- 50% of available height }, { title = "Neo-Tree Git", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "git_status" end, pinned = true, -- always shown even with no windows collapsed = true, -- starts closed open = "Neotree position=right git_status", }, { title = function() -- dynamic title from current buffer local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]" return vim.fn.fnamemodify(buf_name, ":t") end, ft = "Outline", pinned = true, open = "SymbolsOutlineOpen", }, }, -- Windows matching these filetypes go to the bottom panel bottom = { { ft = "toggleterm", size = { height = 0.4 }, -- Only non-floating toggleterm windows filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == "" end, }, "Trouble", -- shorthand: just the filetype string { ft = "qf", title = "QuickFix" }, { ft = "help", size = { height = 20 }, filter = function(buf) return vim.bo[buf].buftype == "help" end, }, }, -- Per-position size defaults options = { left = { size = 40 }, bottom = { size = 12 }, right = { size = 40 }, top = { size = 10 }, }, -- Animation settings animate = { enabled = true, fps = 30, cps = 120, on_begin = function() vim.g.minianimate_disable = true end, on_end = function() vim.g.minianimate_disable = false end, spinner = { frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, interval = 80, }, }, -- Exit Neovim when only edgy windows remain exit_when_last = false, -- Close edgebar when all its windows are hidden close_when_all_hidden = true, -- Global window options applied to all edgebar windows wo = { winbar = true, -- show edgy's custom winbar winfixwidth = true, winhighlight = "WinBar:EdgyWinBar,WinBarNC:EdgyWinBarNC,Normal:EdgyNormal", spell = false, signcolumn = "no", scrolloff = 0, }, -- Custom buffer-local keymaps for edgebar windows keys = { ["q"] = function(win) win:close() end, [""] = function(win) win:hide() end, ["Q"] = function(win) win.view.edgebar:close() end, ["]w"] = function(win) win:next({ visible = true, focus = true }) end, ["[w"] = function(win) win:prev({ visible = true, focus = true }) end, [">"] = function(win) win:resize("width", 2) end, [""]= function(win) win:resize("width", -2) end, ["+"] = function(win) win:resize("height", 2) end, ["-"] = function(win) win:resize("height", -2) end, ["="] = function(win) win.view.edgebar:equalize() end, }, icons = { closed = " ", open = " ", }, }) ``` ``` -------------------------------- ### require("edgy").get_win(window?) Source: https://github.com/folke/edgy.nvim/blob/main/README.md Get the Edgy.Window object for the given window or the current window. ```APIDOC ## `require("edgy").get_win(window?)` ### Description Get the Edgy.Window object for the given window or the current window. ### Parameters #### Path Parameters - **window** (window)? - Optional window handle to get the Edgy.Window object for. If not provided, the current window is used. ``` -------------------------------- ### Install edgy.nvim with lazy.nvim Source: https://context7.com/folke/edgy.nvim/llms.txt Add this configuration to your lazy.nvim plugins table to install edgy.nvim. It sets recommended Neovim options for edgebar windows and split behavior. ```lua -- In your lazy.nvim plugins table: { "folke/edgy.nvim", event = "VeryLazy", init = function() -- Required for fully collapsible edgebar windows vim.opt.laststatus = 3 -- Prevents main splits jumping when an edgebar opens vim.opt.splitkeep = "screen" end, opts = { bottom = { { ft = "toggleterm", size = { height = 0.4 }, filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == "" end, }, { ft = "lazyterm", title = "LazyTerm", size = { height = 0.4 } }, "Trouble", { ft = "qf", title = "QuickFix" }, { ft = "help", size = { height = 20 }, filter = function(buf) return vim.bo[buf].buftype == "help" end, }, }, left = { { title = "Files", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, size = { height = 0.5 }, }, { title = "Git", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "git_status" end, pinned = true, collapsed = true, open = "Neotree position=right git_status", }, "neo-tree", -- catch-all for any other neo-tree windows }, -- Disable animation if you prefer instant transitions animate = { enabled = false }, }, }, ``` -------------------------------- ### require("edgy").get_win(window?) Source: https://context7.com/folke/edgy.nvim/llms.txt Gets the `Edgy.Window` object for a given window ID, or for the current window if no argument is provided. Returns `nil` if the window is not managed by edgy.nvim. The returned object exposes methods like `:close()`, `:hide()`, `:show()`, `:toggle()`, `:resize()`, `:focus()`, `:next()`, `:prev()`. ```APIDOC ## `require("edgy").get_win(window?) ### Description Get the `Edgy.Window` object for a window. Returns the `Edgy.Window` wrapper object for a given window ID, or for the current window if no argument is provided. Returns `nil` if the window is not managed by edgy.nvim. The returned object exposes methods like `:close()`, `:hide()`, `:show()`, `:toggle()`, `:resize()`, `:focus()`, `:next()`, `:prev()`. ### Parameters #### Path Parameters - **window** (integer) - Optional - The window ID to get the `Edgy.Window` object for. If not provided, the current window is used. ### Request Example ```lua -- Get edgy wrapper for current window local win = require("edgy").get_win() if win then print("In edgebar: " .. win.view.edgebar.pos) print("View title: " .. win.view.get_title()) print("Is pinned: " .. tostring(win:is_pinned())) print("Is visible: " .. tostring(win.visible)) end -- Get wrapper for a specific window ID local winid = vim.api.nvim_get_current_win() local edgy_win = require("edgy").get_win(winid) if edgy_win then -- Resize width by 5 columns edgy_win:resize("width", 5) -- Navigate to the next visible window in the same edgebar edgy_win:next({ visible = true, focus = true }) end ``` ``` -------------------------------- ### Edgy.nvim Plugin Configuration Source: https://github.com/folke/edgy.nvim/blob/main/README.md Configuration for the edgy.nvim plugin, including options for bottom and left edgebars. This setup customizes filetype handling, filtering, titles, and sizes for various views. ```lua { "folke/edgy.nvim", event = "VeryLazy", init = function() vim.opt.laststatus = 3 vim.opt.splitkeep = "screen" end, opts = { bottom = { -- toggleterm / lazyterm at the bottom with a height of 40% of the screen { ft = "toggleterm", size = { height = 0.4 }, -- exclude floating windows filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == "" end, }, { ft = "lazyterm", title = "LazyTerm", size = { height = 0.4 }, filter = function(buf) return not vim.b[buf].lazyterm_cmd end, }, "Trouble", { ft = "qf", title = "QuickFix" }, { ft = "help", size = { height = 20 }, -- only show help buffers filter = function(buf) return vim.bo[buf].buftype == "help" end, }, { ft = "spectre_panel", size = { height = 0.4 } }, }, left = { -- Neo-tree filesystem always takes half the screen height { title = "Neo-Tree", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, size = { height = 0.5 }, }, { title = "Neo-Tree Git", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "git_status" end, pinned = true, collapsed = true, -- show window as closed/collapsed on start open = "Neotree position=right git_status", }, { title = "Neo-Tree Buffers", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "buffers" end, pinned = true, collapsed = true, -- show window as closed/collapsed on start open = "Neotree position=top buffers", }, { title = function() local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]" return vim.fn.fnamemodify(buf_name, ":t") end, ft = "Outline", pinned = true, open = "SymbolsOutlineOpen", }, -- any other neo-tree windows "neo-tree", }, }, } ``` -------------------------------- ### Get Edgy.Window Object Source: https://context7.com/folke/edgy.nvim/llms.txt Retrieves the Edgy.Window wrapper object for a given window ID or the current window. Returns nil if the window is not managed by edgy.nvim. The wrapper provides methods for window manipulation. ```lua -- Get edgy wrapper for current window local win = require("edgy").get_win() if win then print("In edgebar: " .. win.view.edgebar.pos) print("View title: " .. win.view.get_title()) print("Is pinned: " .. tostring(win:is_pinned())) print("Is visible: " .. tostring(win.visible)) end ``` ```lua -- Get wrapper for a specific window ID local winid = vim.api.nvim_get_current_win() local edgy_win = require("edgy").get_win(winid) if edgy_win then -- Resize width by 5 columns edgy_win:resize("width", 5) -- Navigate to the next visible window in the same edgebar edgy_win:next({ visible = true, focus = true }) end ``` -------------------------------- ### require("edgy").goto_main() Source: https://github.com/folke/edgy.nvim/blob/main/README.md Move the cursor to the last focused main window. ```APIDOC ## `require("edgy").goto_main()` ### Description Move the cursor to the last focused main window. ``` -------------------------------- ### Initialize edgy.nvim with Layout Configuration Source: https://context7.com/folke/edgy.nvim/llms.txt Call this once during Neovim startup to register your window layout. Configure views for each position (left, right, top, bottom) using filetype matching and optional filters. Global and per-view options, animations, keymaps, and icons can be set here. ```lua -- Recommended Neovim options (set before or alongside setup) vim.opt.laststatus = 3 -- required for fully collapsible windows vim.opt.splitkeep = "screen" -- prevents main splits from jumping require("edgy").setup({ -- Windows matching these filetypes go to the left edgebar left = { { title = "Neo-Tree", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "filesystem" end, size = { height = 0.5 }, -- 50% of available height }, { title = "Neo-Tree Git", ft = "neo-tree", filter = function(buf) return vim.b[buf].neo_tree_source == "git_status" end, pinned = true, -- always shown even with no windows collapsed = true, -- starts closed open = "Neotree position=right git_status", }, { title = function() -- dynamic title from current buffer local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]" return vim.fn.fnamemodify(buf_name, ":t") end, ft = "Outline", pinned = true, open = "SymbolsOutlineOpen", }, }, -- Windows matching these filetypes go to the bottom panel bottom = { { ft = "toggleterm", size = { height = 0.4 }, -- Only non-floating toggleterm windows filter = function(buf, win) return vim.api.nvim_win_get_config(win).relative == "" end, }, "Trouble", -- shorthand: just the filetype string { ft = "qf", title = "QuickFix" }, { ft = "help", size = { height = 20 }, filter = function(buf) return vim.bo[buf].buftype == "help" end, }, }, -- Per-position size defaults options = { left = { size = 40 }, bottom = { size = 12 }, right = { size = 40 }, top = { size = 10 }, }, -- Animation settings animate = { enabled = true, fps = 30, cps = 120, on_begin = function() vim.g.minianimate_disable = true end, on_end = function() vim.g.minianimate_disable = false end, spinner = { frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, interval = 80, }, }, -- Exit Neovim when only edgy windows remain exit_when_last = false, -- Close edgebar when all its windows are hidden close_when_all_hidden = true, -- Global window options applied to all edgebar windows wo = { winbar = true, -- show edgy's custom winbar winfixwidth = true, winhighlight = "WinBar:EdgyWinBar,WinBarNC:EdgyWinBarNC,Normal:EdgyNormal", spell = false, signcolumn = "no", scrolloff = 0, }, -- Custom buffer-local keymaps for edgebar windows keys = { ["q"] = function(win) win:close() end, [""] = function(win) win:hide() end, ["Q"] = function(win) win.view.edgebar:close() end, ["]w"] = function(win) win:next({ visible = true, focus = true }) end, ["[w"] = function(win) win:prev({ visible = true, focus = true }) end, [">"] = function(win) win:resize("width", 2) end, [""]= function(win) win:resize("width", -2) end, ["+"] = function(win) win:resize("height", 2) end, ["-"] = function(win) win:resize("height", -2) end, ["="] = function(win) win.view.edgebar:equalize() end, }, icons = { closed = " ", open = " ", }, }) ``` -------------------------------- ### Configure Edgy.nvim Options Source: https://github.com/folke/edgy.nvim/blob/main/doc/edgy.nvim.txt Set global and window-specific options for edgy.nvim. Customize closing behavior, winbar settings, and buffer-local keymaps. ```lua -- close edgy when all windows are hidden instead of opening one of them -- disable to always keep at least one edgy split visible in each open section close_when_all_hidden = true, -- global window options for edgebar windows ---@type vim.wo wo = { -- Setting to `true`, will add an edgy winbar. -- Setting to `false`, won't set any winbar. -- Setting to a string, will set the winbar to that string. winbar = true, winfixwidth = true, winfixheight = false, winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal", spell = false, signcolumn = "no", }, -- buffer-local keymaps to be added to edgebar buffers. -- Existing buffer-local keymaps will never be overridden. -- Set to false to disable a builtin. ---@type table keys = { -- close window ["q"] = function(win) win:close() end, -- hide window [""] = function(win) win:hide() end, -- close sidebar ["Q"] = function(win) win.view.edgebar:close() end, -- next open window ["]w"] = function(win) win:next({ visible = true, focus = true }) end, -- previous open window ["[w"] = function(win) win:prev({ visible = true, focus = true }) end, -- next loaded window ["]W"] = function(win) win:next({ pinned = false, focus = true }) end, -- prev loaded window ["[W"] = function(win) win:prev({ pinned = false, focus = true }) end, -- increase width [">"] = function(win) win:resize("width", 2) end, -- decrease width [""] = function(win) win:resize("width", -2) end, -- increase height ["+"] = function(win) win:resize("height", 2) end, -- decrease height ["-"] = function(win) win:resize("height", -2) end, -- reset all custom sizing ["="] = function(win) win.view.edgebar:equalize() end, }, icons = { closed = " ", open = " ", }, -- enable this on Neovim <= 0.10.0 to properly fold edgebar windows. -- Not needed on a nightly build >= June 5, 2023. fix_win_height = vim.fn.has("nvim-0.10.0") == 0, } ``` -------------------------------- ### Control Edgy.nvim Windows Programmatically Source: https://context7.com/folke/edgy.nvim/llms.txt Access `Edgy.Window` instances via `require("edgy").get_win()` or through edgebar configuration key callbacks to manage window visibility, navigation, and sizing. Use `win:toggle()`, `win:show()`, `win:hide()`, `win:close()`, `win:next()`, `win:prev()`, `win:resize()`, and `win:focus()` for control. You can also check window state with `win:is_valid()` and `win:is_pinned()`, and equalize sizes with `edgebar:equalize()`. ```lua -- In keys config callbacks, `win` is an Edgy.Window instance: require("edgy").setup({ keys = { -- Toggle visibility [""] = function(win) win:toggle() -- show if hidden, hide if shown end, -- Explicitly show or hide ["zo"] = function(win) win:show(true) -- show end, ["zc"] = function(win) win:hide() -- hide (equivalent to win:show(false)) end, -- Close the underlying Neovim window entirely ["X"] = function(win) win:close() end, -- Navigate siblings in the same edgebar [""] = function(win) win:next({ visible = true, focus = true }) end, [""] = function(win) win:prev({ visible = true, focus = true }) end, -- Resize: positive grows, negative shrinks, nil resets to default ["="] = function(win) win:resize("width", nil) -- reset to configured default end, -- Focus a window (shows it if hidden, then sets current) [""] = function(win) win:focus() end, }, }) -- Outside of setup, retrieve and control windows directly: local edgy_win = require("edgy").get_win() if edgy_win then -- Check state print(edgy_win:is_valid()) -- true if the nvim window is still open print(edgy_win:is_pinned()) -- true if this is a placeholder pinned window -- Equalize all window sizes in the parent edgebar edgy_win.view.edgebar:equalize() end ``` -------------------------------- ### require("edgy").open(pos?) Source: https://github.com/folke/edgy.nvim/blob/main/README.md Open all pinned views in the specified position. ```APIDOC ## `require("edgy").open(pos?)` ### Description Open all pinned views in the specified position. ### Parameters #### Path Parameters - **pos** (string)? - Optional position of the edgebar to open pinned views in (e.g., 'top', 'bottom', 'left', 'right'). If not provided, all pinned views in all edgebars are opened. ``` -------------------------------- ### require("edgy").select(pos?, filter?) Source: https://github.com/folke/edgy.nvim/blob/main/README.md Select a window using vim.ui.select in the specified position or all edgebars, with an optional filter. ```APIDOC ## `require("edgy").select(pos?, filter?)` ### Description Select a window using `vim.ui.select` in the specified position or all edgebars, with an optional filter. ### Parameters #### Path Parameters - **pos** (string)? - Optional position to select from (e.g., 'top', 'bottom', 'left', 'right'). - **filter** (fun(buf:buffer, win:window))? - Optional function to filter the selectable windows. ``` -------------------------------- ### Recommended Neovim Options for edgy.nvim Source: https://github.com/folke/edgy.nvim/blob/main/README.md Configure Neovim's laststatus and splitkeep options for better integration with edgy.nvim's window management features. ```lua -- views can only be fully collapsed with the global statusline vim.opt.laststatus = 3 -- Default splitting will cause your main splits to jump when opening an edgebar. -- To prevent this, set `splitkeep` to either `screen` or `topline`. vim.opt.splitkeep = "screen" ``` -------------------------------- ### Edgy.Window Methods Source: https://context7.com/folke/edgy.nvim/llms.txt Individual edgebar windows expose methods for visibility, navigation, and sizing. Access an `Edgy.Window` instance via `require("edgy").get_win()` or through edgebar configuration key callbacks. ```APIDOC ## `Edgy.Window` methods — Programmatic window control Individual edgebar windows expose methods for visibility, navigation, and sizing. Access an `Edgy.Window` instance via `require("edgy").get_win()` or through edgebar configuration key callbacks. ### Methods - **`toggle()`**: Toggles the visibility of the window (shows if hidden, hides if shown). - **`show(boolean)`**: Explicitly shows the window. If `true`, it's shown; if `false`, it's hidden. - **`hide()`**: Hides the window (equivalent to `show(false)`). - **`close()`**: Closes the underlying Neovim window entirely. - **`next(options)`**: Navigates to the next sibling window in the same edgebar. Options can include `visible = true` and `focus = true`. - **`prev(options)`**: Navigates to the previous sibling window in the same edgebar. Options can include `visible = true` and `focus = true`. - **`resize(dimension, value)`**: Resizes the window. `dimension` can be 'width' or 'height'. `value` can be a number (positive grows, negative shrinks) or `nil` to reset to the configured default. - **`focus()`**: Focuses the window. If hidden, it will be shown first. - **`is_valid()`**: Returns `true` if the Neovim window is still open, `false` otherwise. - **`is_pinned()`**: Returns `true` if this is a placeholder pinned window, `false` otherwise. ### Example Usage ```lua -- In keys config callbacks, `win` is an Edgy.Window instance: require("edgy").setup({ keys = { -- Toggle visibility [""] = function(win) win:toggle() -- show if hidden, hide if shown end, -- Explicitly show or hide ["zo"] = function(win) win:show(true) -- show end, ["zc"] = function(win) win:hide() -- hide (equivalent to win:show(false)) end, -- Close the underlying Neovim window entirely ["X"] = function(win) win:close() end, -- Navigate siblings in the same edgebar [""] = function(win) win:next({ visible = true, focus = true }) end, [""] = function(win) win:prev({ visible = true, focus = true }) end, -- Resize: positive grows, negative shrinks, nil resets to default ["="] = function(win) win:resize("width", nil) -- reset to configured default end, -- Focus a window (shows it if hidden, then sets current) [""] = function(win) win:focus() end, }, }) -- Outside of setup, retrieve and control windows directly: local edgy_win = require("edgy").get_win() if edgy_win then -- Check state print(edgy_win:is_valid()) -- true if the nvim window is still open print(edgy_win:is_pinned()) -- true if this is a placeholder pinned window -- Equalize all window sizes in the parent edgebar edgy_win.view.edgebar:equalize() end ``` ``` -------------------------------- ### Edgy Configuration Options Source: https://github.com/folke/edgy.nvim/blob/main/doc/edgy.nvim.txt Configuration options for edgy.nvim, controlling its behavior and appearance. ```APIDOC ## Configuration Options ### `close_when_all_hidden` - **Type**: `boolean` - **Default**: `true` - **Description**: Close edgy when all windows are hidden instead of opening one of them. Set to `false` to always keep at least one edgy split visible in each open section. ### `wo` (Window Options) - **Type**: `vim.wo` (table) - **Description**: Global window options for edgebar windows. - `winbar` (boolean or string): Setting to `true` will add an edgy winbar. Setting to `false` won't set any winbar. Setting to a string will set the winbar to that string. - `winfixwidth` (boolean): Fix the width of the edgebar window. - `winfixheight` (boolean): Fix the height of the edgebar window. - `winhighlight` (string): Highlight groups for the winbar and normal mode. - `spell` (boolean): Enable spell checking in edgebar windows. - `signcolumn` (string): Configure the sign column for edgebar windows. ### `keys` (Buffer-local Keymaps) - **Type**: `table` - **Description**: Buffer-local keymaps to be added to edgebar buffers. Existing buffer-local keymaps will never be overridden. Set to `false` to disable a builtin. - `q`: Close the window. - ``: Hide the window. - `Q`: Close the sidebar. - `]w`, `[w`: Next/Previous open window (visible and focused). - `]W`, `[W`: Next/Previous loaded window (pinned). - `>`, ``: Increase/Decrease width by 2. - `+`, `-`: Increase/Decrease height by 2. - `=`: Reset all custom sizing. ### `icons` - **Type**: `table` - **Description**: Icons used for edgebar states. - `closed` (string): Icon for a closed edgebar. - `open` (string): Icon for an open edgebar. ### `fix_win_height` - **Type**: `boolean` - **Description**: Enable this on Neovim <= 0.10.0 to properly fold edgebar windows. Not needed on a nightly build >= June 5, 2023. ``` -------------------------------- ### require("edgy").open(pos?) Source: https://context7.com/folke/edgy.nvim/llms.txt Opens all pinned views across all edgebars, or only those in the specified position. Each pinned view's `open` function or command is called to populate the slot. ```APIDOC ## `require("edgy").open(pos?) ### Description Opens all pinned views across all edgebars, or only those in the given position (`"left"`, `"right"`, `"top"`, `"bottom"`). Each pinned view's `open` function or command is called to populate the slot. ### Parameters #### Path Parameters - **pos** (string) - Optional - The position of the edgebar to open views in. Can be one of: `"left"`, `"right"`, `"top"`, `"bottom"`. ### Request Example ```lua -- Open all pinned views in all positions require("edgy").open() -- Open only left-side pinned views require("edgy").open("left") ``` ``` -------------------------------- ### Default Configuration for Edgy.nvim Source: https://github.com/folke/edgy.nvim/blob/main/README.md This is the default configuration table for edgy.nvim. It defines the initial layout, animation settings, and window options. Adjust these values to customize the behavior of edge windows. ```lua { left = {}, ---@type (Edgy.View.Opts|string)[] bottom = {}, ---@type (Edgy.View.Opts|string)[] right = {}, ---@type (Edgy.View.Opts|string)[] top = {}, ---@type (Edgy.View.Opts|string)[] ---@type table options = { left = { size = 30 }, bottom = { size = 10 }, right = { size = 30 }, top = { size = 10 }, }, -- edgebar animations animate = { enabled = true, fps = 100, -- frames per second cps = 120, -- cells per second on_begin = function() vim.g.minianimate_disable = true end, on_end = function() vim.g.minianimate_disable = false end, -- Spinner for pinned views that are loading. -- if you have noice.nvim installed, you can use any spinner from it, like: -- spinner = require("noice.util.spinners").spinners.circleFull, spinner = { frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, interval = 80, }, }, -- enable this to exit Neovim when only edgy windows are left exit_when_last = false, -- close edgy when all windows are hidden instead of opening one of them -- disable to always keep at least one edgy split visible in each open section close_when_all_hidden = true, -- global window options for edgebar windows ---@type vim.wo wo = { -- Setting to `true`, will add an edgy winbar. -- Setting to `false`, won't set any winbar. -- Setting to a string, will set the winbar to that string. winbar = true, winfixwidth = true, winfixheight = false, winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal", spell = false, signcolumn = "no", }, -- buffer-local keymaps to be added to edgebar buffers. -- Existing buffer-local keymaps will never be overridden. -- Set to false to disable a builtin. ---@type table keys = { -- close window ["q"] = function(win) win:close() end, -- hide window [""] = function(win) win:hide() end, -- close sidebar ["Q"] = function(win) win.view.edgebar:close() end, -- next open window ["]w"] = function(win) win:next({ visible = true, focus = true }) end, -- previous open window ["[w"] = function(win) win:prev({ visible = true, focus = true }) end, -- next loaded window ["]W"] = function(win) win:next({ pinned = false, focus = true }) end, -- prev loaded window ["[W"] = function(win) win:prev({ pinned = false, focus = true }) end, -- increase width [">"] = function(win) win:resize("width", 2) end, -- decrease width [""] = function(win) win:resize("width", -2) end, -- increase height ["+"] = function(win) win:resize("height", 2) end, -- decrease height ["-"] = function(win) win:resize("height", -2) end, -- reset all custom sizing ["="] = function(win) win.view.edgebar:equalize() end, }, icons = { closed = " ", open = " ", }, -- enable this on Neovim <= 0.10.0 to properly fold edgebar windows. -- Not needed on a nightly build >= June 5, 2023. fix_win_height = vim.fn.has("nvim-0.10.0") == 0, } ``` -------------------------------- ### Opt out individual buffers or windows Source: https://context7.com/folke/edgy.nvim/llms.txt Set buffer-local or window-local variables to `true` to prevent edgy.nvim from managing a specific buffer or window. ```APIDOC ## `vim.b[buf].edgy_disable` / `vim.w[win].edgy_disable` — Opt out individual buffers or windows Set these buffer-local or window-local variables to `true` to prevent edgy.nvim from managing a specific buffer or window, even if its filetype matches a configured view. This can be applied at any time — edgy will expunge the window from the layout dynamically. ### Usage - **`vim.b[buf].edgy_disable = true`**: Disables edgy management for a specific buffer. - **`vim.w[win].edgy_disable = true`**: Disables edgy management for a specific window. - **`vim.b[buf].edgy_disable = nil`** or **`vim.w[win].edgy_disable = nil`**: Re-enables edgy management by clearing the variable. ### Example ```lua -- Disable edgy for the current buffer (e.g. in a plugin's setup) vim.api.nvim_create_autocmd("FileType", { pattern = "neo-tree", callback = function(ev) -- Opt this specific neo-tree buffer out of edgy management if some_condition then vim.b[ev.buf].edgy_disable = true end end, }) -- Disable edgy for the current window local win = vim.api.nvim_get_current_win() vim.w[win].edgy_disable = true -- Re-enable by clearing the variable vim.b[vim.api.nvim_get_current_buf()].edgy_disable = nil ``` ``` -------------------------------- ### Edgy.nvim API Functions Source: https://github.com/folke/edgy.nvim/blob/main/doc/edgy.nvim.txt Public API for controlling edgy.nvim, including selecting, closing, opening, and toggling views, as well as navigating to the main window. ```markdown - `require("edgy").select(pos?, filter?)` select a window with `vim.ui.select` in the given position or in all edgebars using an optional filter - `require("edgy").close(pos?)` close all edgebars or a edgebar in the given position - `require("edgy").open(pos?)` open all pinned views in the given position - `require("edgy").toggle(pos?)` toggle all pinned views in the given position - `require("edgy").goto_main()` move the cursor to the last focused main window - `require("edgy").get_win(window?)` get the Edgy.Window object for the given window or the current window ``` -------------------------------- ### require("edgy").toggle(pos?) Source: https://github.com/folke/edgy.nvim/blob/main/README.md Toggle the visibility of all pinned views in the specified position. ```APIDOC ## `require("edgy").toggle(pos?)` ### Description Toggle the visibility of all pinned views in the specified position. ### Parameters #### Path Parameters - **pos** (string)? - Optional position of the edgebar to toggle pinned views in (e.g., 'top', 'bottom', 'left', 'right'). If not provided, pinned views in all edgebars are toggled. ``` -------------------------------- ### Edgy.nvim Keymaps for Edgebar Windows Source: https://github.com/folke/edgy.nvim/blob/main/doc/edgy.nvim.txt Common keybindings for interacting with edgebar windows, including closing, hiding, and navigating between windows. ```markdown Keymap Description -------- ------------------------- q Close the window Hide the window Q Close the edgebar ]w, [w Next/Prev open window ]W, [W Next/Prev loaded window ```