Keyboard shortcuts for cells, editing, and navigation.
pynb has two modes: edit mode (cursor inside a cell editor) and command mode (cell selected but editor not focused). Press Escape to switch from edit mode to command mode, and Enter to switch back.
Cell Execution
| Shortcut | Action |
|---|
| Shift+Enter | Run cell and advance to next |
| Cmd+Enter | Run cell and stay |
| Alt+Enter | Run cell and insert new cell below |
File
| Shortcut | Action |
|---|
| Cmd+S | Save notebook |
| Cmd+N | New notebook |
| Cmd+, | Open Settings |
Edit Mode (inside cell editor)
| Shortcut | Action |
|---|
| Cmd+/ | Toggle comment |
| Cmd+. | Trigger autocomplete |
| Ctrl+Space | Trigger autocomplete |
| Shift+Tab | Inspect symbol |
| F12 | Go to definition |
| Cmd+Alt+D | Go to definition |
| Alt+H | Show hover info |
| F2 | Rename symbol |
| Tab | Indent (or insert spaces) |
| Escape | Exit to command mode |
Command Mode (cell selected, editor not focused)
| Shortcut | Action |
|---|
| Enter | Enter edit mode |
| Up / k | Select previous cell |
| Down / j | Select next cell |
| a | Insert cell above |
| b | Insert cell below |
| d, d | Delete cell (press d twice) |
| z | Undo cell deletion |
| m | Change cell to Markdown |
| y | Change cell to Code |
| c | Copy cell |
| x | Cut cell |
| v | Paste cell |
| Shift+Enter | Run cell and advance |
Find
| Shortcut | Action |
|---|
| Cmd+F | Open find bar |
| Cmd+Z | Undo (when not in editor, undoes cell deletion) |
Standard macOS
These are inherited from the system and work automatically.
| Shortcut | Action |
|---|
| Cmd+Z | Undo |
| Cmd+Shift+Z | Redo |
| Cmd+A | Select All |
| Cmd+C / Cmd+X / Cmd+V | Copy / Cut / Paste |