# Keyboard shortcuts

> Default keyboard shortcuts in the Hansard app and how to change them.

The app has keyboard shortcuts for search and navigation. You can change any
of them except the Mac app's history and view keys. On a Mac, Primary means
Command; elsewhere it means Control.

- App: **Settings → Shortcuts**

## Default shortcuts

### Search

| Action                 | Shortcut          | What it does                                               |
| ---------------------- | ----------------- | ---------------------------------------------------------- |
| Search                 | `/`               | Focus the search field in Sessions, Memories, or Settings. |
| Find in page           | `Primary+F`       | Find text in the open conversation or memory.              |
| Next match in page     | `Primary+G`       | Jump to the next match of **Find in page**.                |
| Previous match in page | `Primary+Shift+G` | Jump to the previous match of **Find in page**.            |
| Next search result     | `N`               | Jump to the next matching message in archive search.       |
| Previous search result | `Shift+N`         | Jump to the previous matching message in archive search.   |

### Navigation

| Action                | Shortcut          | What it does                                                                                       |
| --------------------- | ----------------- | -------------------------------------------------------------------------------------------------- |
| Toggle sidebar        | `Primary+\`       | Show or hide the sidebar.                                                                          |
| Next sidebar item     | `J`               | Move to the next conversation or memory in the sidebar.                                            |
| Previous sidebar item | `K`               | Move to the previous conversation or memory in the sidebar.                                        |
| Open boards           | `Primary+Shift+M` | Browse [project discussions and shared topics](https://www.hansard.dev/guides/session-messaging/). |
| Open settings         | `Primary+,`       | Open Settings, or leave it when it is already open.                                                |

### Workspace

| Action           | Shortcut          | What it does                                                                                                                                             |
| ---------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Toggle workspace | `Primary+B`       | Show or hide the [changes, files, and terminals](https://www.hansard.dev/guides/browse-conversations/#work-beside-a-conversation) beside a conversation. |
| Open terminal    | `Primary+J`       | Open a terminal in the conversation's folder, or return to the conversation from it.                                                                     |
| Go to file       | `Primary+Shift+E` | Find and open a file in the conversation's project.                                                                                                      |

### Mac app

The Mac app has no browser toolbar, so it adds fixed history and view keys.
Back and Forward also sit at the left of the title bar, and the mouse's side
buttons move back and forward. The browser viewer leaves these keys to the
browser.

| Action      | Shortcut                   | What it does                                                                                                                     |
| ----------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Back        | `Command+[`                | Return to the previous view or conversation.                                                                                     |
| Forward     | `Command+]`                | Go forward again after Back.                                                                                                     |
| Open a view | `Command+1` to `Command+9` | Open the dock's views in order: Sessions, Projects, Boards, Graph, Stats, Memories, Skills & plugins, Accounts, and Deep Recall. |

Hold Command for a moment to see the key that completes each shortcut on screen: the dock's numbers, `,` on Settings, `\` on the sidebar button, `F` on Find, and `[` and `]` on Back and Forward.

## Change a shortcut in the app

1. Open **Settings** and select **Shortcuts**.
2. Select the shortcut you want to change. When it shows **Type shortcut**,
   press the new keys. Hansard saves the change right away.
3. To turn a shortcut off, press Backspace or Delete while recording. Press
   Escape to cancel without changing anything.
4. To restore every default, select **Restore defaults**.

Shortcuts are saved in this app or browser profile, so the Mac app and the
browser viewer keep their own sets.
