folke / edgy.nvim

Easily create and manage predefined window layouts, bringing a new edge to your workflow
Apache License 2.0
840 stars 17 forks source link

feature: Hide and Show Edgy Windows While Preserving Content #60

Closed tummetott closed 3 months ago

tummetott commented 10 months ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

I've configured edgy.nvim to display help, trouble, manpage, and quickfix windows. Due to limited screen space, there are times when I'd like to temporarily hide the edgy window to focus on my codebase, only to return to, for example, the help menu later. Unfortunately, the current functionality doesn't allow hiding the edgy window without closing its content. While the require("edgy").toggle(pos?) API function exists, it only toggles pinned views, and there's no direct way to restore a specific help or manual buffer that was being read.

Additionally, there is the "hide" keymap, yet its functionality differs from the desired behavior. While it effectively collapses within the edgbar, it doesn't contribute to expanding available screen space. Instead, it simply makes more room for other edgy configured windows within the existing display layout.

I appreciate edgy's unified concept, especially the ability to close every configured window with q. It would be beneficial if there were a command to toggle every edgy window without losing its content, providing a seamless way to manage visibility without disrupting the current state of individual buffers.

Describe the solution you'd like

I propose the inclusion of two new functions in the edgy.nvim API:

-- This function would be designed to hide the edgbar at a specified 
-- position without removing its content.
require("edgy").hide(pos?)

-- This function would facilitate the display of the hidden edgbar at 
-- the specified position, restoring its visibility.
require("edgy").show(pos?)

Furthermore, for consistency in naming conventions, the existing keymap:

["<c-q>"] = function(win) win:hide() end

-- could be more aptly renamed to:

["<c-q>"] = function(win) win:collapse() end

This adjustment aims to provide a clearer and more cohesive naming structure for keymap actions within the edgy.nvim configuration.

Describe alternatives you've considered

I've explored the idea of creating a custom keymap to minimize the edgy window:

["<c-w>_"] = function(win)
    win:resize("height", [min value])
end,

However, the result doesn't look very nice to me.

Additional context

No response

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

folke commented 3 months ago

not possible