Automatically balance panes in Herdr as panes are created, closed, or exited.
Important
This plugin requires Python 3.6 or newer.
Install directly from GitHub:
herdr plugin install jeph/herdr-pane-balancerConfirm that the plugin is installed and enabled:
herdr plugin listIf it is disabled, enable it explicitly:
herdr plugin enable herdr-pane-balancerStarting with two equal panes:
+----------------+----------------+
| | |
| | |
| A | B |
| | |
| | |
| | |
+----------------+----------------+
Split pane B to the right:
Without the plugin With Herdr Pane Balancer
+----------------+-------+--------+ +----------+----------+----------+
| | | | | | | |
| | | | | | | |
| A | B | New | | A | B | New |
| | | | | | | |
| | | | | | | |
| | | | | | | |
+----------------+-------+--------+ +----------+----------+----------+
Herdr normally halves only the pane being split, leaving A twice as wide as B and New. The plugin automatically rebalances the three columns to equal widths.
Starting with 3 panes:
+----------------+----------------+
| | |
| | B |
| | |
| A +----------------+
| | |
| | C |
| | |
+----------------+----------------+
Split pane C to the right:
Without the plugin With Herdr Pane Balancer
+----------------+----------------+ +----------------+----------------+
| | | | | |
| | B | | A | B |
| | | | | |
| A +-------+--------+ +----------------+----------------+
| | | | | | |
| | C | New | | C | New |
| | | | | | |
+----------------+-------+--------+ +----------------+----------------+
Instead of leaving the new pane nested inside the bottom-right region, the plugin rebuilds the tab as an even 2-by-2 grid.
Starting with an even 2-by-2 grid:
+----------------+----------------+
| | |
| A | B |
| | |
+----------------+----------------+
| | |
| C | D |
| | |
+----------------+----------------+
Split pane D to the right:
Without the plugin With Herdr Pane Balancer
+----------------+----------------+ +----------+----------+-----------+
| | | | | | |
| A | B | | A | B | C |
| | | | | | |
+----------------+----------------+ +----------+----------+-----------+
| | | | | | |
| C | D | New | | D | New |
| | | | | | |
+----------------+-------+--------+ +----------------+----------------+
For five panes, the plugin builds a balanced three-pane top row and two-pane bottom row.
When a pane closes, surviving panes keep their left-to-right, top-to-bottom order. The plugin
rebuilds the grid only if the collapsed layout cannot represent the balanced target shape. In the
five-pane example above, closing C leaves A B / D New, closing A leaves B C / D New, and
closing D produces A B / C New, moving only C into the second row.
Starting with three panes above two panes:
+----------+----------+-----------+
| | | |
| A | B | C |
| | | |
+----------+----------+-----------+
| | |
| D | E |
| | |
+----------------+----------------+
Split pane E to the right:
Without the plugin With Herdr Pane Balancer
+----------+----------+-----------+ +----------+----------+-----------+
| | | | | | | |
| A | B | C | | A | B | C |
| | | | | | | |
+----------+----------+-----------+ +----------+----------+-----------+
| | | | | | | |
| D | E | New | | D | E | New |
| | | | | | | |
+----------------+-------+--------+ +----------+----------+-----------+
The sixth pane completes the second three-pane row, so only its row ratios need changing.