Skip to content

Layout

The [layout] table in config.toml decides where each pane goes. It’s a tree: each node is either a pane or a split that holds more nodes.

The default layout: the graph at 70 percent, and a row of status and branches where details opens
config.toml
[layout]
split = "rows"
children = [
{ pane = "graph", size = 70 },
{ split = "columns", details = true, children = [{ pane = "status" }, { pane = "branches" }] },
]

The graph spans the top 70% of the screen. Status and branches sit side by side below it. That bottom row is marked details = true, so when you open details (space on a commit, or 4), details takes the row’s place until you close it.

Each node has either pane or split, never both.

KeyOnMeans
panea leafOne of graph, status, branches or details.
splita splitrows stacks its children top to bottom; columns puts them side by side, left to right.
childrena splitThe nodes inside it. A split needs at least one; a pane can’t have any.
sizeany nodeA percentage of the parent split, from 1 to 99. Children without a size share whatever is left.
detailsany nodetrue marks the node details opens in place of.

The rules tt-git checks when it loads the layout:

  • graph, status and branches each appear exactly once.
  • Details is placed once: either as a details pane of its own, or by marking one node details = true. Not both.
  • The node marked details = true can’t contain the graph.
  • The sizes in a split can’t add up to more than 100, or to 100 when the split also has children without a size.

A layout that breaks a rule is reported as an error when tt-git starts, with what’s wrong.

You have two choices.

Details opens on demand. Mark a node details = true, as the default layout does. Details stays hidden until you press space on a commit in the graph, or 4. It then takes that node’s place until you press space again (in the graph or details), esc, or focus a pane it covers. Nothing loads into details while it’s hidden.

Details is always on screen. Give it a { pane = "details" } leaf of its own instead. It then follows the selection in the graph and branches pane all the time.

+ zooms whatever layout you use: the focused pane (details, or else the graph) fills the screen, and the next + goes back. With the graph zoomed, space opens details below it at full width, and closes it again.

The four-pane layout with status and branches on the left and the graph over details on the right

Earlier versions of tt-git kept details on screen all the time, in a four-pane layout. To get it back:

config.toml
[layout]
split = "columns"
children = [
{ size = 33, split = "rows", children = [{ pane = "status", size = 40 }, { pane = "branches" }] },
{ split = "rows", children = [{ pane = "graph", size = 65 }, { pane = "details" }] },
]

Status (40%) and branches are stacked in the left third. The graph (65%) and details are stacked on the right.

Details opens in place of the right column, next to a full-height graph:

config.toml
[layout]
split = "columns"
children = [
{ pane = "graph", size = 60 },
{ split = "rows", details = true, children = [{ pane = "status" }, { pane = "branches" }] },
]

details = true can go on a single pane, too. Here details covers only the branches pane and leaves status visible:

config.toml
[layout]
split = "rows"
children = [
{ pane = "graph", size = 70 },
{ split = "columns", children = [{ pane = "status" }, { pane = "branches", details = true }] },
]

The layout also decides what ctrl+h, ctrl+j, ctrl+k and ctrl+l do: they focus the pane to the left, below, above or to the right of the focused one, wherever it is on screen. 1 to 4 and tab work the same in any layout. See Moving around.