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.
Contexts
Section titled “Contexts”Bindings belong to a context. Each pane has one, plus global for keys that
work everywhere:
| Context | Where it applies |
|---|---|
global | Everywhere, unless the focused pane’s context binds the same key. |
graph | The graph pane. |
status | The status pane. |
branches | The branches pane, on every tab but Stash and Worktrees. |
stash | The branches pane on its Stash tab. It doesn’t fall back to branches. |
worktrees | The branches pane on its Worktrees tab. It doesn’t fall back to branches. |
details | The details pane. |
stage | The staging view, while you stage a file by hunk or line. |
blame | Blame, 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.
Changing a binding
Section titled “Changing a binding”Name the context’s table, then set a command to one key or a list of keys:
[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.
How to write keys
Section titled “How to write keys”| Write | For |
|---|---|
q, Q, ?, +, } | A character. Uppercase means shift: Q and shift+q are the same key. |
ctrl+c, alt+enter, ctrl+alt+x | Modifiers joined with +. control and meta work too. |
ctrl++ | ctrl with the + key. |
space, enter, esc, tab, shift+tab, backspace | Named keys. return, escape, backtab also work. |
up, down, left, right | Arrow keys. |
home, end, pageup, pagedown | Also pgup, pgdn. |
delete, insert | Also del, ins. |
f1 … f24 | Function keys. |
Names aren’t case-sensitive, except single characters.
Binding plugin actions
Section titled “Binding plugin actions”To run a plugin action with a key, add a
[[keys.command]] entry:
[[keys.command]]key = "ctrl+o"type = "plugin_action"command = "acme.github.open-commit" # the action's qualified iddescription = "open on GitHub" # optionalcontext = "graph" # optional; default: everywhere| Field | |
|---|---|
key | The key, written as above. |
type | Always plugin_action. |
command | The qualified action id: the plugin’s id, a dot, and the action’s id. tt-git plugin action list prints them. |
description | Optional. |
context | Optional. 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.
Commands
Section titled “Commands”Every command you can bind, with its default keys:
| Command | Default | Context |
|---|---|---|
quit | q ctrl+c | global |
help | ? | global |
palette | : ctrl+p | global |
focus_graph, focus_status, focus_branches, focus_details | 1, 2, 3, 4 | global |
focus_next, focus_prev | tab, shift+tab | global |
focus_left, focus_down, focus_up, focus_right | ctrl+h, ctrl+j, ctrl+k, ctrl+l | global |
zoom | + | global |
move_up, move_down | k up, j down | global |
page_up, page_down | ctrl+u pageup, ctrl+d pagedown | global |
top, bottom | g home, G end | global |
refresh | ctrl+r | global |
push, pull | P, p | global |
undo | z | global |
plugin_logs | none (palette only) | global |
self_update | none (palette only) | global |
expand_details | enter | graph, stash |
toggle_details | space | graph, blame |
close_details | esc (graph, stage, blame); esc space (details) | graph, details, stage, blame |
toggle_scope | a | graph |
toggle_dates | t | graph, blame |
filter | f (graph); / (branches, stash, worktrees) | graph, branches, stash, worktrees |
new_branch | n | graph, branches, stash, worktrees |
merge, rebase | M, r | graph, branches |
cherry_pick | C | graph |
agent | A | graph |
copy | c | graph, branches, worktrees, blame |
checkout | o (graph); enter space (branches) | graph, branches |
delete_branch, rename_branch | d, R | branches |
new_tag | T | graph, branches |
push_tag | P (on the Tags tab; pushes the branch on the others) | branches |
fetch | f | branches |
next_tab, prev_tab | ] }, [ { | graph (steps the branches pane’s tabs), branches, stash, worktrees |
pick_base | b | branches |
stage_toggle | space | status, stage |
open_staging | enter | status |
stage_all | a | status |
discard | d | status, stage |
commit | c | status, stage |
amend | A | status |
stash | s | status |
continue, abort | C, X | status |
stash_pop, stash_apply, stash_drop | space, a, d | stash |
open_worktree, remove_worktree | enter space, d | worktrees |
switch_side | tab | stage |
toggle_line_mode | a | stage |
select_range | v | stage |
toggle_files | } | details |
open_link | o | details |
open_in_editor | e | status, details, stage, blame |
blame | b | status, details |
open_commit | enter | blame |
go_to_line | ctrl+g | blame |
blame_back, blame_forward | [, ] | blame |
blame_older, blame_newer | {, } | blame |
search, search_next, search_prev | /, n, N | blame |
A command does nothing in a context it isn’t meant for, so binding, say,
commit in [keys.graph] has no effect.
Keys you can’t rebind
Section titled “Keys you can’t rebind”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.