Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

keybindings.md

97 lines6.5 KB

1# Keybindings
2​
3Customize keyboard shortcuts in **Settings → Keybindings** on web and desktop. That page lists every available command ID and default binding.
4​
5To free a default shortcut, choose **Unassign** from its row menu (**Reset to default** restores it).
6​
7> Note: `mod` means `Cmd` on macOS and `Ctrl` on Windows and Linux.
8​
9## Common composer shortcuts
10​
11| Action | Default | Notes |
12| --------------------------- | ----------------- | ------------------------------------------------------------------ |
13| Start / finish dictation | `mod+shift+d` | `Esc` discards. See [Voice input](./voice-input.md). |
14| Opposite queue/steer action | `mod+Enter` | Uses the non-default follow-up behavior while a turn runs. |
15| Start thread in background | `mod+Alt+Enter` | Also `mod+Enter` in a new thread; opens a fresh draft immediately. |
16| Send first queued message | `mod+Shift+Enter` | Steers if running, or starts a turn if stopped. |
17| Pick model | `mod+shift+m` | `mod+shift+up/down` switches providers inside the picker. |
18| Pick host / environment | `mod+shift+h` | Bind **Composer: Cycle Host** to step without a menu. |
19| Pick effort | `mod+shift+e` | Bind **Increase/Decrease Effort** to step without a menu. |
20| Pick permissions | `mod+shift+a` | |
21| Pick workspace mode | `mod+shift+x` | `mod+shift+l` reuses the previous worktree directly. |
22| Pick Git branch | `mod+shift+g` | |
23​
24Configure whether `Enter` sends or requires `mod+Enter` in **Settings → Chat → Send shortcut** (`Shift+Enter` always inserts a newline).
25​
26In the model picker, use `Left`/`Shift+Tab` to move to the provider list, `Right` to return to search or move into effort levels, and `Up`/`Down`/`Enter` to select.
27​
28## Copy pull request and thread references
29​
30- `mod+shift+c`: Copies the open PR's URL (or copies a thread chip link when no PR is open).
31- `mod+shift+k`: Copies the open PR's `#number`.
32​
33Remap under **Copy Link or Thread** and **Copy Number** in **Settings → Keybindings**.
34​
35## Find
36​
37- **Current thread** (`chat.find`, default `mod+f` outside terminals/previews): Searches all messages and plans in the thread (requires an up-to-date server). Use `Enter` / `Shift+Enter` to step through matches and `Esc` to close.
38- **Diffs** (`mod+f` inside a diff or PR Code tab): Searches all loaded files in the diff, unfolding matching files. Not configurable. Very large uncommitted diffs only search files loaded so far.
39- **Browser page** (`preview.find`, default `mod+f` in a desktop browser tab): Searches the open page. If a page handles `mod+f` itself, use the browser's **⋮** menu. Not supported in web clients or streamed browser tabs.
40​
41## Hardware keyboards on iPad and Android
42​
43- **iPad**: `Cmd+1`–`Cmd+9` open the first nine visible threads; `Cmd+K` opens the command palette (prefix with `>` for actions only); `Cmd+Shift+H` cycles host on a new thread. `Return` sends (`Shift+Return` for newline; `Cmd+Return` for opposite follow-up). Change Return behavior in **Settings → Keyboard**.
44- **Android**: Same composer Return behavior using `Ctrl` instead of `Cmd`. The on-screen keyboard's Return always inserts a newline.
45​
46## Edit the configuration file
47​
48Keybindings are stored on the environment's machine at `~/.t3/userdata/keybindings.json` as a JSON array:
49​
50```json
52 { "key": "mod+g", "command": "terminal.toggle" },
53 { "key": "mod+shift+g", "command": "terminal.new", "when": "terminalFocus" }
55```
56​
57New default bindings are added on startup without overwriting customized commands. Invalid rules are ignored; an unparseable file falls back to defaults.
58​
59### Rule shape and key syntax
60​
61Each rule requires `key` and `command`, plus an optional `when` condition. Project scripts use `script.{id}.run` (e.g. `script.test.run`).
62​
63Join modifiers and keys with `+` (`mod`, `cmd`/`meta`, `ctrl`/`control`, `alt`/`option`, `shift`).
64​
65### When conditions
66​
67Available context keys: `terminalFocus`, `terminalOpen`, `previewFocus`, `previewOpen`, `rightPanelOpen`, `modelPickerOpen`, `usagePageOpen`, `composerFocus`, `draftThreadRoute`, `turnRunning`, `composerEmpty`, `editableFocus`, `isWeb`, `isDesktop`. Unknown keys evaluate to `false`.
68​
69Combine with `!`, `&&`, `||`, and parentheses:
70​
71```json
72{ "key": "mod+j", "command": "terminal.toggle", "when": "terminalOpen && !terminalFocus" }
73```
74​
75> Tip: `mod+1`–`mod+9` default to `isDesktop` so they don't hijack browser tabs. Remove that condition in Settings if you want thread jumps on web.
76​
77## Precedence
78​
79The last matching rule in `keybindings.json` wins, even across different commands. Place more specific rules after general ones.
80​
81## Commands with special behavior
82​
83- `thread.stop`: Interrupts the running turn (unbound by default).
84- `thread.regenerateTitle`: Regenerates the focused thread's title (unbound by default).
85- `thread.undo` (`mod+z`): Undoes recent sidebar actions (unpin, settle, snooze, archive, discard draft) within 5 seconds, including consecutive actions of the same kind.
86- `navigation.back` (`mod+[`) / `navigation.forward` (`mod+]`): Moves through visited pages.
87- `chat.new` / `chat.newLocal` / `chat.newWithoutProject` (`mod+alt+n`): Start new threads using your [new-thread defaults](./thread-sidebar.md#start-a-thread) or [without a project](./thread-sidebar.md#start-without-a-project).
88​
89## Reserved and platform shortcuts
90​
91- `mod+w` (desktop): Closes the focused terminal or active right-panel tab without closing the window. On web, browsers intercept `mod+w`—rebind `rightPanel.close` and `terminal.close` (e.g. `alt+w`).
92- `mod+shift+t`: Reopens the last closed panel tab (files, diffs, PRs, browsers, devices) in order. Browser tabs reopen as fresh sessions. Rebind on web if your browser intercepts it.
93- Keep `!terminalFocus` when remapping shortcuts that shouldn't intercept terminal input. `sidebar.toggle` ignores `Ctrl+B` inside terminals so `tmux` keeps its prefix (`Cmd+B` still works on macOS).
94​
95## Desktop quit shortcut
96​
97`Cmd+Q` (macOS) or `Ctrl+Q` (Windows/Linux) defaults to **Hold** mode: hold for 1.2 seconds or press twice within 500 ms. Change this in **Settings → General → Confirmations → Quit shortcut** to **Direct** or **Double press**. Quitting from the application menu always exits immediately.