Grid
Arranges windows in a dynamic grid that adapts to window count. Every window gets equal space with no hierarchy or main window.
Layout
1 window
┌───────────────────────────────────────────────────────────┐│ ││ ││ ││ ││ ││ ││ ││ 1 ││ ││ ││ ││ ││ ││ ││ ││ ││ │└───────────────────────────────────────────────────────────┘2 windows
┌─────────────────────────────┬─────────────────────────────┐│ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ 1 │ 2 ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ ││ │ │└─────────────────────────────┴─────────────────────────────┘3 windows
┌─────────────────────────────┬─────────────────────────────┐│ │ ││ │ ││ │ ││ 1 │ 2 ││ │ ││ │ ││ │ ││ │ │├─────────────────────────────┴─────────────────────────────┤│ ││ ││ ││ 3 ││ ││ ││ ││ │└───────────────────────────────────────────────────────────┘4 windows
┌─────────────────────────────┬─────────────────────────────┐│ │ ││ │ ││ │ ││ 1 │ 2 ││ │ ││ │ ││ │ ││ │ │├─────────────────────────────┼─────────────────────────────┤│ │ ││ │ ││ │ ││ 3 │ 4 ││ │ ││ │ ││ │ ││ │ │└─────────────────────────────┴─────────────────────────────┘5 windows
┌───────────────────┬───────────────────┬───────────────────┐│ │ │ ││ │ │ ││ │ │ ││ 1 │ 2 │ 3 ││ │ │ ││ │ │ ││ │ │ ││ │ │ │├───────────────────┴───────────────────┼───────────────────┤│ │ ││ │ ││ │ ││ 4 │ 5 ││ │ ││ │ ││ │ ││ │ │└───────────────────────────────────────┴───────────────────┘6 windows
┌───────────────────┬───────────────────┬───────────────────┐│ │ │ ││ │ │ ││ │ │ ││ 1 │ 2 │ 3 ││ │ │ ││ │ │ ││ │ │ ││ │ │ │├───────────────────┼───────────────────┼───────────────────┤│ │ │ ││ │ │ ││ │ │ ││ 4 │ 5 │ 6 ││ │ │ ││ │ │ ││ │ │ ││ │ │ │└───────────────────┴───────────────────┴───────────────────┘Capabilities
- Adjustable ratio: No
- Adjustable nmaster: No
- Stateful: No
How the grid is calculated
Grid dimensions aim for roughly square cells:
columns = ceil(sqrt(window_count))rows = ceil(window_count / columns)| Windows | Columns | Rows | Result |
|---|---|---|---|
| 1 | 1 | 1 | 1x1 |
| 2 | 2 | 1 | 2x1 |
| 3-4 | 2 | 2 | 2x2 |
| 5-6 | 3 | 2 | 3x2 |
| 7-9 | 3 | 3 | 3x3 |
| 10-12 | 4 | 3 | 4x3 |
Incomplete rows
When windows do not fill the grid exactly, the last row stretches:
5 windows in 3x2 grid:
┌───────────────────┬───────────────────┬───────────────────┐│ │ │ ││ │ │ ││ │ │ ││ 1 │ 2 │ 3 ││ │ │ ││ │ │ ││ │ │ ││ │ │ │├───────────────────┴───────────────────┼───────────────────┤│ │ ││ │ ││ │ ││ 4 │ 5 ││ │ ││ │ ││ │ ││ │ │└───────────────────────────────────────┴───────────────────┘Window 4 expands to fill the empty cell, giving both bottom windows equal width.
When to use
Grid works well for:
- Comparing multiple documents or outputs side by side
- Dashboard-style monitoring (logs, metrics, terminals)
- Situations where all windows are equally important
- Quick visual comparison of similar content
Grid vs BSP
Both layouts treat windows equally, but they differ in structure:
| Aspect | Grid | BSP |
|---|---|---|
| Structure | Rows and columns | Binary tree |
| Resizing | Fixed equal size | Per-window ratios |
| State | Stateless | Remembers ratios |
| Best for | Fixed comparison | Flexible many-window |