Keyboard reference
功能的Every notebook shortcut: running cells, command mode, selecting, copying, undoing and moving cells, find, bookmarks, presenting, and how to change them.
Notebooks have two keyboard modes, the same idea as Jupyter's. While you type in a cell's editor, keys type text and only the run shortcuts act on cells. Press ESC and the notebook switches to command mode: the selected cell gets an outline and single keys move between cells, insert, delete and convert them. Press 输入 to go back to editing.
如何阅读这些表格: ⌘ 是 Ctrl 和 ⌥ 是 Alt on Windows and Linux. Every notebook command is also in the command palette (⌘⇧P / Ctrl+Shift+P) under Notebook:, so you can run any of them without a shortcut.
Running cells
These work from anywhere in the notebook, including inside a cell's editor.
| 操作 | macOS | Windows / Linux |
|---|---|---|
| Run the selected cell | ⌘Return | Ctrl+Enter |
| Run the cell and select the next one | ⇧Return | Shift+Enter |
| Run the cell and insert a new cell below | ⌥Return | Alt+Enter |
| Run all cells | ⌘⇧Return | Ctrl+Shift+Enter |
| Stop the run | No default key: use 停止 in the top bar, Query ▸ Stop Notebook Run, or the palette's Notebook: Stop Run, and bind a key if you want one. | |
What "run the cell" includes depends on the run mode switch in the top bar (this cell only, or the cell and its out-of-date inputs). See Running notebooks.
Command mode
ESC inside a cell editor first closes whatever the editor has open (a completion list, a find bar); press it again to enter command mode. Command-mode keys only fire while the notebook itself has focus, so they can never land in your SQL.
| 键 | 操作 |
|---|---|
| J 或者 ↓ | Select the next cell |
| K 或者 ↑ | Select the previous cell |
| A | Insert a cell above |
| B | Insert a cell below |
| I | Open the insert menu: pick any kind of cell with J/K or the arrows, 输入 to insert it below, ESC to close |
| D D | Delete the selected cells (the toast's 撤销 is the same step as Z) |
| M | Turn the selected cells into Markdown |
| Y | Turn the selected cells into SQL |
| O | Collapse or expand the selected cells |
| E | Embed the selected cells' outputs, or show them in full again (see Embedded outputs) |
| P | Pin or unpin the selected cells' outputs in the strip above the cells |
| 输入 | Edit the selected cell |


Selecting cells
Most command-mode keys act on every selected cell, not only the active one. With two or more cells selected, a bar above the cells offers Run, Copy, Cut, Duplicate, Move up, Move down, Collapse, To Markdown, To SQL, Merge, Bookmark, Delete and Clear selection.
| 操作 | macOS | Windows / Linux |
|---|---|---|
| Extend the selection down | ⇧J 或者 ⇧↓ | Shift+J 或者 Shift+Down |
| Extend the selection up | ⇧K 或者 ⇧↑ | Shift+K 或者 Shift+Up |
| Select every cell | ⌘A | Ctrl+A |
| Select a range / add or remove one cell | ⇧-click / ⌘-click | Shift-click / Ctrl-click |
| Clear the selection (closes the insert menu, then the find bar, first) | ESC | |
| Run the selected cells | ⌘⌥Return | Ctrl+Alt+Enter |


Copy, paste, undo and reorder
These are command-mode keys. Inside a cell's editor, ⌘C, ⌘X, ⌘V 和 ⌘Z stay the editor's own text commands.
| 操作 | macOS | Windows / Linux |
|---|---|---|
| Copy the selected cells | C 或者 ⌘C | C 或者 Ctrl+C |
| Cut the selected cells | X 或者 ⌘X | X 或者 Ctrl+X |
| Paste below / above | V 或者 ⌘V / ⇧V | V 或者 Ctrl+V / Shift+V |
| Duplicate the selected cells | ⌘D | Ctrl+D |
| Undo a change to the cells | Z 或者 ⌘Z | Z 或者 Ctrl+Z |
| 重做 | ⇧Z 或者 ⌘⇧Z | Shift+Z 或者 Ctrl+Shift+Z |
| Move the selected cells up / down | ⌥↑ / ⌥↓ | Alt+上箭头 / Alt+下箭头 |
| Merge with the next cell (or merge the selection) | ⇧M | Shift+M |
| Split the cell at the cursor (inside a SQL or Markdown cell's editor) | ⌘⇧- | Ctrl+Shift+- |
- Copied cells paste into the same notebook or another one with new ids, names that don't clash (
orders变为orders_2)和{{…}}references pointing at the pasted copies. Other apps get the copy as a SQL script (when every cell is SQL) or as Markdown with the SQL in code blocks. SQL text pasted into a notebook becomes one cell per statement. Pasted and duplicated cells always start read-only, even copies of a cell that was allowed to change data. - 撤销 covers inserting, deleting, moving, pasting, renaming, converting, changing a cell's settings or connection, find and replace, embedding outputs and AI changes, up to 200 steps per tab. Typing inside a cell stays with that editor's own undo, and undoing a step keeps what you typed since in the cells the step didn't touch. Undo is refused while cells run, and the history is kept only while the tab is open.
- 从字段列表将 a cell, or the whole selection, by the handle at the left of its header; a line shows where it will land and the list scrolls when you reach its edge.
- Merge with previous has no default key: use the cell menu or the palette's Notebook: Merge Cell with Previous.


Find, bookmarks, folds and pins
| 操作 | macOS | Windows / Linux |
|---|---|---|
| Find in the notebook | ⌘F | Ctrl+F |
| Find and replace | ⌘⇧H | Ctrl+Shift+H |
| Next / previous match (in the find field) | 输入 / Shift+Enter | |
| Bookmark the selected cells, or remove their bookmarks | ⌘F2 | Ctrl+F2 |
| Next / previous bookmark (wraps around) | F2 / ⇧F2 | F2 / Shift+F2 |
| Fold or unfold a Markdown heading's section | ⌘⌥[ | Ctrl+Alt+[ |
| Pin or unpin the selected cells' outputs | P | |
- 查找 searches SQL and Markdown, cell names, the notebook title and the text in cell settings such as chart titles, captions and dashboard tile notes, with Match case 和 Whole word。这个 Search results switch also looks in the rows each cell's result holds (found, never replaced, up to 5,000 matches). 替换 和 Replace all are one undo step each; renaming a cell this way updates the cells that refer to it. AI cells are searched but never replaced. There are no regular expressions.
- Bookmarks show a Bookmarked badge in the cell header and are listed on the left rail's Bookmarks 选项卡(Notebook: Show Bookmarks opens it).
- Folding a Markdown heading hides the cells up to the next heading of the same or a higher level; going to a hidden cell unfolds it. Notebook: Unfold All Sections has no default key.
- Pinned outputs sit in a strip above the cells (up to six): the cell's name, state, its first rows and row count, with Go to and Unpin.
Bookmarks, folds and pins are saved in the file, but they never count as an edit to a trusted notebook.




While you type
- 输入 {{ in a SQL cell lists the other cells and
param.; {{param. lists the parameters (andstart,end和end_exclusiveof a date range). AfterFROM {{orders}} o, typingo.offers that cell's columns, from its result or, before it has run, from its query. Hovering over a reference shows the cell's kind, state and columns. - 输入 / at the start of a line in a Markdown cell opens the slash menu: headings, lists, a checklist, a table, a callout, a quote, a divider, a code block, bold, italic, inline code, a link, a picture, a formula value or parameter, or a new cell of any kind below. Ctrl+空格 offers the same snippets anywhere in the cell.
- In a Markdown cell, {{ lists only formula values and parameters, each with its current value (sensitive ones hidden), and there is no SQL completion. 输入 on a list item starts the next item and on an empty item ends the list; 标签页 / ⇧Tab nest and un-nest the item; brackets, backticks and emphasis marks close themselves. See Writing in a Markdown cell.




Dashboard viewer and presentation
While a dashboard is presented full screen (see Dashboards and presentation):
| 键 | 操作 |
|---|---|
| →, ↓, 空格 或者 下一页 | 下一张幻灯片 |
| ←, ↑, ⇧Space 或者 上一页 | 上一张幻灯片 |
| 首页 / 结束 | First / last slide |
| ESC | Leave the presentation (also leaves the dashboard viewer) |
Changing a shortcut
Notebook shortcuts are ordinary keybindings: change them in Settings ▸ Workspace ▸ Keyboard Shortcuts like any other command (see 可自定义的快捷键). The command-mode keys are bound only in command mode, so binding a single letter there does not affect typing. Commands with no default key, such as Notebook: Embed All Outputs, Notebook: Show or Hide Embedded Configuration, Notebook: Show Bookmarks 和 Notebook: Unfold All Sections, can be given one there.