Keyboard shortcuts
⌨️ General
| Mac | Windows & Linux | Action |
|---|---|---|
| ⌘ + P | ctrl + P | Show/Hide command palette |
| ⌘ + K | ctrl + K | Open search bar |
| ⌘ + . | ctrl + . | Hide/Show UI |
| ⌘ + [ | ctrl + [ | Go back |
| ⌘ + ] | ctrl + ] | Go forward |
🧱 Block actions
| Mac | Windows & Linux | Action |
|---|---|---|
| ⇧ + ↵ | shift + enter | Run current block and move cursor to next block (creates a new cell if at the end of the notebook) |
| ⌥ + ↵ | alt + enter | Run block & create code block below |
| ⌘ + ↵ | ctrl + enter | Run current block |
| ⌘ + ⇧ + . | ctrl + shift + . | Stop execution |
| ⌘ + ⌥ + H | ctrl + alt + H | Hide/Show block code |
| ⌘ + ⇧ + H | ctrl + shift + H | Hide/Show block output |
| ⌘ + ⇧ + M | ctrl + shift + M | Toggle between code and Markdown block |
| ⌘ + ⇧ + ⌫ | ctrl + shift + backspace | Delete block |
| ⌥ + ⇧ + ↑ | alt + shift + ↑ | Move block up |
| ⌥ + ⇧ + ↓ | alt + shift + ↓ | Move block down |
| ⌘ + ⇧ + D | ctrl + shift + D | Duplicate block |
| ⌘ + J | ctrl + J | Add new code block below current one |
| ⌘ + K | ctrl + K | Add new code block above current one |
| ⌘ + Z | ctrl + Z | Undo |
| ⌘ + ⇧ + Z | ctrl + shift + Z | Redo |
| ⌘ + ⌥ + C | ctrl + alt + C | Add comment |
| ⌘ + ' | ctrl + ' | More actions |
| ⌘ + ⇧ + E | ctrl + shift + E | Edit code with AI |
| ⌘ + ⇧ + I | ctrl + shift + I | Explain code with AI |
✍️ Code editing
| Mac | Windows & Linux | Action |
|---|---|---|
| ⌘ + D | ctrl + D | Expand selection (multiple cursors) |
| tab | tab | When caret is at the beginning of a line, add indent Otherwise, show autocomplete suggestions |
| ⇧ + tab | shift + tab | Decrease indent |
| ⌘ + / | ctrl + / | Toggle line/selection comment |
| ⌥ + ↓ | alt + ↓ | Move lines down |
| ⌥ + ↑ | alt + ↑ | Move lines up |
| ⌥ + ⇧ + F | alt + shift + F | Format code |
🖥️ Terminal
| Mac | Windows & Linux | Action |
|---|---|---|
| ⌘ + C | ctrl + shift + C | Copy selected text |
| ⌘ + V | ctrl + shift + V | Paste |