zellij
zellij copied to clipboard
Feature: apply layout at runtime
We should be able to allow defining several possible layouts in the layout yaml file: https://zellij.dev/documentation/layouts.html
We should then have some keyboard shortcut that would switch between these layouts, provided that the same amount of panes are open on screen (it would rearrange the open panes to fit the new layout alternate).
I'll work on this over the weekend if no one else has taken this up yet. It looks like I need to:
- Modify the layout file to accept multiple "template" layouts
- Add
Action::NextLayout/Action::PreviousLayoutvariants and bind keys to them - Add
ScreenInstruction::NextLayout/ScreenInstruction::PreviousLayoutvariants to be called from the router. - Add an
update_layoutmethod to both the screen and tab to handle resizing and re-rendering panes. - (Possibly) Add a layouts mode in the status bar to surface the keybindings to the user. I'm not sure if this is necessary.
Does that all sounds about right?
Sounds good to me!
I think it could also be useful to "add" a new layout to current session, opening more tabs as required by the new layout.
This would fit my workflow because I only keep a single terminal window with zellij open at all times, for weeks: When I want to work on e.g. zellij, I could just open a prepared layout that adds a new Tab with panes running vim, cargo watch, and some shell for git commands while leaving all previously opened Tabs/Panes intact.
I was just notified that for single Tabs, the functionality already exists: https://zellij.dev/documentation/keybindings-actions.html#newtab-tablayout
Would love to be able to do this, specifically so I can switch back and forth to the compact-bar at will.
The interface is excellent and very friendly for new users, but once you learn the commands it feels a bit needlessly busy.
I'm at a sort of middle ground, where I can get by on memory most of the time, but still need to reference things once in a while. It would be great if I could start off with the compact bar, but be able to switch to a layout containing the full default status bar on-the-fly using a keyboard shortcut in the instances where I need it.
Edit: I just noticed https://github.com/zellij-org/zellij/issues/1400 exists for this very use case... sorry for the noise, I guess it's already on the roadmap.
Check out zellij-forgot.