Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Herdr Pane Balancer

Automatically balance panes in Herdr as panes are created, closed, or exited.

Installation

Important

This plugin requires Python 3.6 or newer.

Install directly from GitHub:

herdr plugin install jeph/herdr-pane-balancer

Confirm that the plugin is installed and enabled:

herdr plugin list

If it is disabled, enable it explicitly:

herdr plugin enable herdr-pane-balancer

Behavior at a glance

Adding a third pane

Starting 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.

Going from three panes to four

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.

Going from four panes to five

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.

Going from five panes to six

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.

About

Automatically balance, equalize, and tile Herdr terminal panes on create, close, and exit.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Contributors

Languages