# Keyboard shortcuts

> The default shortcuts, and how to change them in the Keymap tab or keymap.json.

Every command is in the command palette (<Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>P</Kbd>) with its shortcut beside it. Hover tooltips and right-click menus show shortcuts too.

## Everyday shortcuts

### Workspace

| Action                       | Shortcut                                          |
| ---------------------------- | ------------------------------------------------- |
| Quick open file              | <Kbd>⌘</Kbd> <Kbd>P</Kbd>                         |
| Command palette              | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>P</Kbd>            |
| New tab (console, agent, browser) | <Kbd>⌘</Kbd> <Kbd>N</Kbd>                    |
| New default tab              | <Kbd>⌘</Kbd> <Kbd>T</Kbd>                         |
| Close tab or split           | <Kbd>⌘</Kbd> <Kbd>W</Kbd>                         |
| Reopen closed tab            | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>T</Kbd>            |
| Add a pane column            | <Kbd>⌘</Kbd> <Kbd>\\</Kbd>                        |
| Floating terminal            | <Kbd>⌘</Kbd> <Kbd>J</Kbd>                         |
| Open project                 | <Kbd>⌘</Kbd> <Kbd>O</Kbd>                         |
| New worktree                 | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>N</Kbd>            |
| Worktree picker              | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>W</Kbd>            |
| Next / previous worktree     | <Kbd>⌘</Kbd> <Kbd>`</Kbd> / <Kbd>⌘</Kbd> <Kbd>~</Kbd> |
| Live agents                  | <Kbd>⌘</Kbd> <Kbd>E</Kbd>                         |
| Next / previous agent card   | <Kbd>⌃</Kbd> <Kbd>`</Kbd> / <Kbd>⌃</Kbd> <Kbd>~</Kbd> |
| Go back / forward            | <Kbd>⌃</Kbd> <Kbd>-</Kbd> / <Kbd>⌃</Kbd> <Kbd>⇧</Kbd> <Kbd>-</Kbd> |
| Text size up / down / reset  | <Kbd>⌘</Kbd> <Kbd>=</Kbd> / <Kbd>⌘</Kbd> <Kbd>-</Kbd> / <Kbd>⌘</Kbd> <Kbd>0</Kbd> |

### Sidebar and dock

| Action                        | Shortcut                                          |
| ----------------------------- | ------------------------------------------------- |
| Toggle / focus Projects sidebar | <Kbd>⌘</Kbd> <Kbd>B</Kbd> / <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>B</Kbd> |
| Toggle / focus right dock     | <Kbd>⌘</Kbd> <Kbd>R</Kbd> / <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>R</Kbd> |
| Agents                        | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>A</Kbd>            |
| Files                         | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>E</Kbd>            |
| Search                        | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>F</Kbd>            |
| Git                           | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>G</Kbd>            |
| Forge                         | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>U</Kbd>            |
| Problems                      | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>M</Kbd>            |
| Next / previous problem       | <Kbd>F8</Kbd> / <Kbd>⇧</Kbd> <Kbd>F8</Kbd>        |

### Editor and review

| Action                        | Shortcut                                          |
| ----------------------------- | ------------------------------------------------- |
| Save / save all               | <Kbd>⌘</Kbd> <Kbd>S</Kbd> / <Kbd>⌘</Kbd> <Kbd>⌥</Kbd> <Kbd>S</Kbd> |
| Find / next / previous        | <Kbd>⌘</Kbd> <Kbd>F</Kbd> / <Kbd>⌘</Kbd> <Kbd>G</Kbd> / <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>G</Kbd> |
| Symbol outline                | <Kbd>⌘</Kbd> <Kbd>⇧</Kbd> <Kbd>O</Kbd>            |
| Go to definition              | <Kbd>F12</Kbd>                                    |
| Comment for an agent          | <Kbd>⌘</Kbd> <Kbd>I</Kbd>                         |
| Add selection to an agent's prompt | <Kbd>⌘</Kbd> <Kbd>L</Kbd>                    |
| Commit                        | <Kbd>⌘</Kbd> <Kbd>↵</Kbd> in the commit box       |

Page-specific keys are on each page: [Terminal](/docs/workspace/terminal), [Editor](/docs/workspace/editor), [Files and search](/docs/workspace/files-and-search), [Browser](/docs/workspace/browser).

## Change a shortcut

### In the Keymap tab

Open it from the keyboard button at the bottom of the Projects sidebar, or **rexa: show keymap**. Each row shows an action, its arguments, keys, context and source (Default or User). Search to find one, and switch between Compact and Full views.

Click a row's record button and press the new keys. If the keys are taken, Rexa names the clash and asks before rebinding.

### In keymap.json

Your bindings live in `~/.config/rexa/keymap.json`. Rexa applies the file when you save it. The Keymap tab has buttons to open your file and a read-only copy of the defaults.

```json [~/.config/rexa/keymap.json]
[
  {
    "context": "Rexa",
    "bindings": {
      "cmd-shift-z": "rexa::ToggleZenMode",
      "cmd-shift-u": null
    }
  },
  {
    "context": "Editor",
    "bindings": { "cmd-k cmd-s": "rexa::SaveAll" }
  }
]
```

- **Keys** are written like `cmd-shift-z`. A sequence is space-separated: `cmd-k cmd-r`.
- **The action** is a name such as `rexa::ToggleZenMode`, or `["action", argument]`.
- **`null` unbinds** the keys, and keeps them unbound if a later version adds a default there.
- **Context** limits where the binding applies: `Rexa` for everywhere, or `Editor`, `Terminal`, `Pane`, `Console`, `FilePanel`, `Sidebar`, `Browser`. The most specific context wins.

Copy action names from the default keymap or the Keymap tab. Some commands have no default shortcut, such as `rexa::ToggleZenMode`, `rexa::OpenSettings` and `rexa::ToggleStatusBar`.

<Callout type="caution" title="Plain JSON only">
  `keymap.json` must be plain JSON: no comments, no trailing commas. A file that does not parse is ignored and the defaults apply. A single bad entry is skipped.
</Callout>

Write `cmd-~` rather than `` cmd-shift-` ``, and `cmd-{` rather than `cmd-shift-[`; the shifted form never fires.

## Which-key

Turn on `editor.which_key`, or run **editor: toggle which-key**, to show what can follow a partly typed chord or Vim command after 300 ms.
