toggle-pane.yazi
Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's ratio settings!
Assume the user's ratio is [A, B, C], that is, \text{parent}=A, \text{current}=B, \text{preview}=C:
min-parent: Toggles between0andA- the parent is either completely hidden or showed with widthA.max-parent: Toggles betweenAand\infty- the parent is either showed with widthAor fills the entire screen.min-current: Toggles between0andB- the current is either completely hidden or showed with widthB.max-current: Toggles betweenBand\infty- the current is either showed with widthBor fills the entire screen.min-preview: Toggles between0andC- the preview is either completely hidden or showed with widthC.max-preview: Toggles betweenCand\infty- the preview is either showed with widthCor fills the entire screen.reset: Resets to the user's configuredratio.
Installation
ya pack -a yazi-rs/plugins:full-border
Usage
Hide/Show preview:
[[manager.prepend_keymap]]
on = "T"
run = "plugin toggle-pane min-preview"
desc = "Show or hide the preview pane"
Maximize/Restore preview:
[[manager.prepend_keymap]]
on = "T"
run = "plugin toggle-pane max-preview"
desc = "Maximize or restore the preview pane"
You can replace preview with current or parent to toggle the other columns.
Advanced
In addition to triggering the plugin with a keypress, you can also trigger it in your init.lua file:
if os.getenv("NVIM") then
require("toggle-pane"):entry("min-preview")
end
In the example above, when it detects that you're using Yazi in nvim, the preview is hidden by default — you can always press T (or any key you've bound) to show it again.
License
This plugin is MIT-licensed. For more information, check the LICENSE file.