Skip to content

Key bindings

Every key in tt-git can be changed in the [keys] tables of config.toml. For the full list of default keys, see Keyboard shortcuts.

Bindings belong to a context. Each pane has one, plus global for keys that work everywhere:

ContextWhere it applies
globalEverywhere, unless the focused pane’s context binds the same key.
graphThe graph pane.
statusThe status pane.
branchesThe branches pane, on every tab but Stash and Worktrees.
stashThe branches pane on its Stash tab. It doesn’t fall back to branches.
worktreesThe branches pane on its Worktrees tab. It doesn’t fall back to branches.
detailsThe details pane.
stageThe staging view, while you stage a file by hunk or line.
blameBlame, while the details pane blames a file.

When you press a key, tt-git looks it up in the focused pane’s context first, then in global. That’s why a means “all branches / current branch” in the graph but “stage everything” in the status pane.

Name the context’s table, then set a command to one key or a list of keys:

config.toml
[keys.global]
quit = ["q", "ctrl+c"]
palette = ":"
[keys.graph]
toggle_scope = "b"
[keys.branches]
checkout = ["enter", "o"]

The keys you set replace that command’s default keys in that context. In the example, palette = ":" removes the default ctrl+p. To keep a default, list it too.

Changing a command in one context leaves the others alone. [keys.graph] new_branch = "N" changes the key in the graph only; n still makes a branch in the branches pane.

The help bar, the help popup (?) and the command palette all show your keys, not the defaults.

WriteFor
q, Q, ?, +, }A character. Uppercase means shift: Q and shift+q are the same key.
ctrl+c, alt+enter, ctrl+alt+xModifiers joined with +. control and meta work too.
ctrl++ctrl with the + key.
space, enter, esc, tab, shift+tab, backspaceNamed keys. return, escape, backtab also work.
up, down, left, rightArrow keys.
home, end, pageup, pagedownAlso pgup, pgdn.
delete, insertAlso del, ins.
f1 … f24Function keys.

Names aren’t case-sensitive, except single characters.

To run a plugin action with a key, add a [[keys.command]] entry:

config.toml
[[keys.command]]
key = "ctrl+o"
type = "plugin_action"
command = "acme.github.open-commit" # the action's qualified id
description = "open on GitHub" # optional
context = "graph" # optional; default: everywhere
Field
keyThe key, written as above.
typeAlways plugin_action.
commandThe qualified action id: the plugin’s id, a dot, and the action’s id. tt-git plugin action list prints them.
descriptionOptional.
contextOptional. One of the contexts above; the default is global, so the key works in every pane.

Plugin bindings are checked before the built-in ones, and a binding for the focused pane’s context wins over a global one. The command palette shows the key next to the action.

Every command you can bind, with its default keys:

CommandDefaultContext
quitq ctrl+cglobal
help?global
palette: ctrl+pglobal
focus_graph, focus_status, focus_branches, focus_details1, 2, 3, 4global
focus_next, focus_prevtab, shift+tabglobal
focus_left, focus_down, focus_up, focus_rightctrl+h, ctrl+j, ctrl+k, ctrl+lglobal
zoom+global
move_up, move_downk up, j downglobal
page_up, page_downctrl+u pageup, ctrl+d pagedownglobal
top, bottomg home, G endglobal
refreshctrl+rglobal
push, pullP, pglobal
undozglobal
plugin_logsnone (palette only)global
self_updatenone (palette only)global
expand_detailsentergraph, stash
toggle_detailsspacegraph, blame
close_detailsesc (graph, stage, blame); esc space (details)graph, details, stage, blame
toggle_scopeagraph
toggle_datestgraph, blame
filterf (graph); / (branches, stash, worktrees)graph, branches, stash, worktrees
new_branchngraph, branches, stash, worktrees
merge, rebaseM, rgraph, branches
cherry_pickCgraph
agentAgraph
copycgraph, branches, worktrees, blame
checkouto (graph); enter space (branches)graph, branches
delete_branch, rename_branchd, Rbranches
new_tagTgraph, branches
push_tagP (on the Tags tab; pushes the branch on the others)branches
fetchfbranches
next_tab, prev_tab] }, [ {graph (steps the branches pane’s tabs), branches, stash, worktrees
pick_basebbranches
stage_togglespacestatus, stage
open_stagingenterstatus
stage_allastatus
discarddstatus, stage
commitcstatus, stage
amendAstatus
stashsstatus
continue, abortC, Xstatus
stash_pop, stash_apply, stash_dropspace, a, dstash
open_worktree, remove_worktreeenter space, dworktrees
switch_sidetabstage
toggle_line_modeastage
select_rangevstage
toggle_files}details
open_linkodetails
open_in_editorestatus, details, stage, blame
blamebstatus, details
open_commitenterblame
go_to_linectrl+gblame
blame_back, blame_forward[, ]blame
blame_older, blame_newer{, }blame
search, search_next, search_prev/, n, Nblame

A command does nothing in a context it isn’t meant for, so binding, say, commit in [keys.graph] has no effect.

A few keys belong to dialogs and lists rather than to a pane, and are fixed:

  • In dialogs and prompts: enter confirms, esc cancels, tab switches options (worktree, what to stash), ctrl+u clears the text, and y/n answer a yes/no question.
  • In the palette and pickers: up/down or ctrl+p/ctrl+n move.
  • In the help popup: type to search, backspace and ctrl+u edit the search, esc closes.
  • While you type a filter or a blame search: backspace deletes, enter keeps it and esc drops it.
  • In plugin panes, the keys in [plugins] pane_release_keys (default ctrl+\ and f12); every other key goes to the plugin.