Cell operations 17
| Action | Windows / Linux | Mac |
|---|---|---|
| Copy Cell | C | C |
| Cut Cell | X | X |
| Delete CellA two-key sequence: press D twice while the notebook is in command mode. | DthenD | DthenD |
| Insert Cell Above | A | A |
| Insert Cell Below | B | B |
| Merge Selected Cells | Shift+M | Shift+M |
| Merge Cell AboveJoins the current cell with its upper neighbour; written with Ctrl for every system. | Ctrl+Backspace | Ctrl+Backspace |
| Merge Cell BelowJoins the current cell with its lower neighbour; written with Ctrl for every system. | Ctrl+Shift+M | Ctrl+Shift+M |
| Paste Cell BelowInserts the cut or copied cells under the current one. | V | V |
| Redo Cell Operation | Shift+Z | Shift+Z |
| Show Line NumbersCommand mode toggle for the line numbers in cell editors. | Shift+L | Shift+L |
| Split CellThe one cell operation bound in edit mode: the cell is divided where the text cursor stands. | Ctrl+Shift+- | Ctrl+Shift+- |
| Undo Cell OperationReverses the last change made to cells, not text typed inside a cell. | Z | Z |
| Render Side-by-SideToggles side-by-side rendering for the current notebook only. | Shift+R | Shift+R |
| Move Cell Up | Ctrl+Shift+Up | Ctrl+Shift+Up |
| Move Cell Down | Ctrl+Shift+Down | Ctrl+Shift+Down |
| Toggle output visibilityAdded by Notebook 7 in its own schema; JupyterLab ships the command without a default key. | O | O |
Cell types and headings 11
| Action | Windows / Linux | Mac |
|---|---|---|
| Change to Code Cell Type | Y | Y |
| Change to Heading 1Number keys 1 to 6 set the heading level and respond only while a Markdown cell has focus. | 1 | 1 |
| Change to Heading 2 | 2 | 2 |
| Change to Heading 3 | 3 | 3 |
| Change to Heading 4 | 4 | 4 |
| Change to Heading 5 | 5 | 5 |
| Change to Heading 6 | 6 | 6 |
| Change to Markdown Cell Type | M | M |
| Change to Raw Cell Type | R | R |
| Insert Heading AboveAdds a new heading cell above the heading that the current cell belongs to. | Shift+A | Shift+A |
| Insert Heading Below | Shift+B | Shift+B |
Running cells and kernel 6
| Action | Windows / Linux | Mac |
|---|---|---|
| Interrupt KernelPress I twice; ignored while focus is in an editable field, so use it from command mode. | IthenI | IthenI |
| Restart KernelPress 0 twice; ignored while focus is in an editable field, so use it from command mode. | 0then0 | 0then0 |
| Run SelectedRun menu binding for any element marked as a code runner; this is what makes the keys work in command mode. | Shift+Enter | Shift+Return |
| Run cell and stayBound in both modes; a Mac accepts Ctrl with Return as well as Cmd. | Ctrl+Enter | Cmd+ReturnorCtrl+Return |
| Run and insert cell belowBound in both modes; a fresh cell appears under the one that was executed. | Alt+Enter | Option+Return |
| Run cell and advanceEdit mode binding: executes the cell, then moves the selection to the following cell. | Shift+Enter | Shift+Return |
Edit mode 8
| Action | Windows / Linux | Mac |
|---|---|---|
| Open completionsBrings up the completer in a cell editor, except when the cursor is at the start of a line. | Tab | Tab |
| Enter Command ModeLeaves the cell editor; single letters then act on cells and the border turns gray. | Esc | Esc |
| Enter Command ModeSecond binding beside Esc; it uses Ctrl on a Mac too. | Ctrl+M | Ctrl+M |
| Previous kernel history entrySteps back through code the kernel has already executed while a cell is being edited. | Alt+Up | Option+Up |
| Next kernel history entry | Alt+Down | Option+Down |
| Dismiss tooltipApplies while a tooltip is open over a notebook cell. | Esc | Esc |
| Show tooltipNeeds a cursor past the leading whitespace, no selected text and a closed completer. | Shift+Tab | Shift+Tab |
| Insert chosen completionApplies while the completer list is open; added by application code, so no schema file lists it. | Enter | Return |
Code editor 16
The same keys can carry two commands with different selectors, and the binding whose selector matches nearest to the focused element runs. That is why one combination deletes a line in an editor and opens a sidebar elsewhere.
| Action | Windows / Linux | Mac |
|---|---|---|
| Delete lineRemoves the whole line under the cursor in any CodeMirror editor: cells, consoles and text files. | Ctrl+D | Cmd+D |
| Delete lineSecond binding; in an editor it takes precedence over the Table of Contents shortcut on the same keys. | Ctrl+Shift+K | Cmd+Shift+K |
| Toggle Block Comment | Alt+A | Option+A |
| Toggle Comment | Ctrl+/ | Cmd+/ |
| Select Next OccurrenceIn an editor these keys add the following match to the selection, not Simple Interface mode. | Ctrl+Shift+D | Cmd+Shift+D |
| Toggle BoldMarkdown editors only: wraps the selected text in double asterisks, or removes them. | Ctrl+B | Cmd+B |
| Next Inline Completion | Alt+] | Option+] |
| Previous Inline Completion | Alt+[ | Option+[ |
| Accept Inline CompletionApplies only while an inline suggestion is showing. | Tab | Tab |
| Accept Inline CompletionAlternative to Tab while an inline suggestion is showing. | Alt+End | Option+End |
| Invoke Inline CompleterRequests an inline suggestion at the cursor; bound wherever a completer is enabled. | Alt+\ | Option+\ |
| Open completions in a text fileSame completer as in notebooks, bound for the file editor; inactive at the start of a line. | Tab | Tab |
| Redo text editWindows and Linux also accept Ctrl with Y, which the schema lists as a separate entry. | Ctrl+Shift+ZorCtrl+Y | Cmd+Shift+Z |
| Undo text editEditor-level undo, separate from the single-letter cell undo of command mode. | Ctrl+Z | Cmd+Z |
| Show tooltip in a text fileFile editor binding; it needs a cursor past the indentation and no selected text. | Shift+Tab | Shift+Tab |
| Insert completion in a text fileFile editor binding that applies while the completer list is open. | Enter | Return |
Find and replace 6
| Action | Windows / Linux | Mac |
|---|---|---|
| Find in documentOpens the built-in search of JupyterLab in any searchable document, replacing the browser search. | Ctrl+F | Cmd+F |
| Find and Replace | Ctrl+H | Cmd+H |
| Find Next | Ctrl+G | Cmd+G |
| Find Previous | Ctrl+Shift+G | Cmd+Shift+G |
| Search in SelectionAvailable while a search is active; limits matching to the current selection. | Alt+L | Option+L |
| End SearchCloses the search box while a search is active. | Esc | Esc |
Files and documents 8
| Action | Windows / Linux | Mac |
|---|---|---|
| Close TabCloses the main-area activity that has focus; it uses Option on a Mac. | Alt+W | Option+W |
| Print document | Ctrl+P | Cmd+P |
| Save document | Ctrl+S | Cmd+S |
| Save As | Ctrl+Shift+S | Cmd+Shift+S |
| Close and Shut DownThe schema writes Ctrl, not Accel, so a Mac uses Ctrl here too. | Ctrl+Shift+Q | Ctrl+Shift+Q |
| Reopen Closed Document | Ctrl+Shift+T | Cmd+Shift+T |
| Open Settings Editor | Ctrl+, | Cmd+, |
| Save User SettingsInside the Settings Editor the save keys store the edited settings. | Ctrl+S | Cmd+S |
File browser 9
| Action | Windows / Linux | Mac |
|---|---|---|
| Go UpOpens the parent folder while the file list has focus. | Backspace | Backspace |
| Delete itemThe JupyterLab command list labels this command Move to Trash. | Delete | Delete |
| Cut item | Ctrl+X | Cmd+X |
| Copy item | Ctrl+C | Cmd+C |
| Paste item | Ctrl+V | Cmd+V |
| Rename item | F2 | F2 |
| Duplicate itemOn a selected file these keys make a copy; in an editor they delete a line. | Ctrl+D | Cmd+D |
| Select All items | Ctrl+A | Cmd+A |
| Show File BrowserToggles the main file browser panel; bound on the whole page. | Ctrl+Shift+F | Cmd+Shift+F |
Tabs and layout 12
Notebook 7 loads the JupyterLab plugin behind the tab and sidebar shortcuts only on its file browser page, so its notebook, console and editor pages do not register them.
| Action | Windows / Linux | Mac |
|---|---|---|
| Activate Next TabWritten with Ctrl in the schema, so a Mac uses Ctrl here, not Cmd. | Ctrl+Shift+] | Ctrl+Shift+] |
| Activate Previous Tab | Ctrl+Shift+[ | Ctrl+Shift+[ |
| Activate Next Tab Bar | Ctrl+Shift+. | Ctrl+Shift+. |
| Activate Previous Tab Bar | Ctrl+Shift+, | Ctrl+Shift+, |
| Simple InterfaceSwitches JupyterLab between the multi-tab layout and one document at a time. | Ctrl+Shift+D | Cmd+Shift+D |
| Show Left SidebarShows or hides the left sidebar; in a Markdown editor the same keys toggle bold. | Ctrl+B | Cmd+B |
| Show Right Sidebar | Ctrl+J | Cmd+J |
| Fullscreen ModeWhile the debugger is stopped at a breakpoint F11 steps in instead. | F11 | F11 |
| Activate Command PaletteOpens the searchable list of every command, the keyboard route to actions without a binding. | Ctrl+Shift+C | Cmd+Shift+C |
| Show Keyboard ShortcutsLists the bindings relevant to the widget that is active at that moment. | Ctrl+Shift+H | Cmd+Shift+H |
| New Launcher | Ctrl+Shift+L | Cmd+Shift+L |
| Activate Previously Used TabJumps back to the tab that had focus before the current one. | Ctrl+Shift+' | Cmd+Shift+' |
Sidebars and panels 26
The Alt + digit sidebar toggles have no Mac default: the schema overrides each of them with an empty macKeys entry.
| Action | Windows / Linux | Mac |
|---|---|---|
| Toggle left sidebar panel 1Alt with a digit toggles the left sidebar panel at that position; 0 stands for the tenth. | Alt+1 | — |
| Toggle left sidebar panel 2 | Alt+2 | — |
| Toggle left sidebar panel 3 | Alt+3 | — |
| Toggle left sidebar panel 4 | Alt+4 | — |
| Toggle left sidebar panel 5 | Alt+5 | — |
| Toggle left sidebar panel 6 | Alt+6 | — |
| Toggle left sidebar panel 7 | Alt+7 | — |
| Toggle left sidebar panel 8 | Alt+8 | — |
| Toggle left sidebar panel 9 | Alt+9 | — |
| Toggle left sidebar panel 10 | Alt+0 | — |
| Toggle right sidebar panel 1Adding Shift addresses the panels of the right sidebar by position. | Alt+Shift+1 | — |
| Toggle right sidebar panel 2 | Alt+Shift+2 | — |
| Toggle right sidebar panel 3 | Alt+Shift+3 | — |
| Toggle right sidebar panel 4 | Alt+Shift+4 | — |
| Toggle right sidebar panel 5 | Alt+Shift+5 | — |
| Toggle right sidebar panel 6 | Alt+Shift+6 | — |
| Toggle right sidebar panel 7 | Alt+Shift+7 | — |
| Toggle right sidebar panel 8 | Alt+Shift+8 | — |
| Toggle right sidebar panel 9 | Alt+Shift+9 | — |
| Toggle right sidebar panel 10 | Alt+Shift+0 | — |
| Property Inspector | Ctrl+Shift+U | Cmd+Shift+U |
| Extension Manager | Ctrl+Shift+X | Cmd+Shift+X |
| Show Contextual Help | Ctrl+I | Cmd+I |
| Sessions and Tabs | Ctrl+Shift+B | Cmd+Shift+B |
| Search tabs and sessionsOpens a modal search over open tabs and running sessions; the Mac binding is Cmd with Option. | Ctrl+Alt+A | Cmd+Option+A |
| Table of ContentsOutside an editor these keys open the outline sidebar; inside one they delete a line. | Ctrl+Shift+K | Cmd+Shift+K |
Debugger 9
| Action | Windows / Linux | Mac |
|---|---|---|
| Debugger Panel | Ctrl+Shift+E | Cmd+Shift+E |
| Continue or pauseBound on the whole page, unlike the step keys, which need a stopped thread. | F9 | F9 |
| Terminate debugging | Shift+F9 | Shift+F9 |
| Step over (Next)Active only while the debugger has a stopped thread. | F10 | F10 |
| Step InWith a stopped thread F11 steps into the call; otherwise it toggles fullscreen mode. | F11 | F11 |
| Step Out | Shift+F11 | Shift+F11 |
| Run line in debug consoleEvaluates the input of the debug console prompt; added by debugger code, not a schema file. | Shift+Enter | Shift+Return |
| Open completions in debug console | Tab | Tab |
| Insert completion in debug consoleApplies while the completer list of the debug console is open. | Enter | Return |
Console 8
| Action | Windows / Linux | Mac |
|---|---|---|
| Open completions at the promptConsole prompt binding of the completer; inactive at the start of a line. | Tab | Tab |
| Run Cell (forced)Bound in both console interaction modes, notebook and terminal. | Shift+Enter | Shift+Return |
| Insert Line BreakTerminal interaction mode only, where plain Enter is taken by the run command. | Ctrl+Enter | Cmd+Return |
| Run Cell (unforced)Applies only when the console interaction mode is set to terminal. | Enter | Return |
| Dismiss tooltip at the promptCloses the open tooltip of a console prompt. | Esc | Esc |
| Show tooltip at the promptConsole prompt binding; it needs a cursor past the indentation and no selected text. | Shift+Tab | Shift+Tab |
| Open scratchpad consoleNotebook 7 only, on notebook, console and editor pages; JupyterLab uses these keys for the left sidebar. | Ctrl+B | Cmd+B |
| Insert completion at the promptTakes over Enter while the completer list is open in a console. | Enter | Return |
Image viewer 8
| Action | Windows / Linux | Mac |
|---|---|---|
| Flip horizontallyBound only while an image viewer tab has focus. | H | H |
| Flip vertically | V | V |
| Invert Colors | I | I |
| Reset Image | 0 | 0 |
| Rotate Clockwise | ] | ] |
| Rotate Counterclockwise | [ | [ |
| Zoom In | = | = |
| Zoom Out | - | - |
No row on this page matches that filter.
Notes
→ Related guide: Keyboard shortcuts every data scientist should know
Command mode
Press Esc to leave the cell editor; the cell border turns gray, and blue again once you are back in Edit mode. Then A and B insert a cell above or below, D, D (D pressed twice) deletes the selected cell, M turns it into Markdown and Y back into code. C, X and V copy, cut and paste whole cells, and Shift with the arrow keys selects several so they can be moved or deleted together. Enter returns to Edit mode in the selected cell.
Running
Shift + Enter runs the cell and selects the next one — pressing it repeatedly walks down a notebook — while Ctrl + Enter runs and stays, which is what you want when re-running one cell while tuning a parameter. Alt + Enter runs and inserts an empty cell below. All three work in both modes. On a Mac, run-and-stay answers to Cmd + Return as well as Ctrl + Return, and run-and-insert is Option + Return. Interrupting a running cell is I, I in Command mode, and 0, 0 restarts the kernel.
Inside a cell
In Edit mode, Tab opens the completer and Shift + Tab shows a tooltip for the code at the cursor. Ctrl + / toggles a comment on the selected lines (Cmd + / on a Mac). Because the editor captures most keys in Edit mode, cell operations do not work there — if A inserts a letter instead of a cell, press Esc first.
Questions
Which Jupyter shortcuts keep Ctrl on a Mac?
JupyterLab writes most modifier shortcuts with Accel, which is Cmd on a Mac and Ctrl on Windows and Linux. Bindings written with a literal Ctrl stay on Ctrl everywhere: Ctrl + M to enter command mode, Ctrl + Shift + - to split a cell, Ctrl + Shift + Up to move a cell up, and the tab-switching keys such as Ctrl + Shift + ]. Alt bindings use the Option key.
Do these shortcuts apply to Notebook 7 or to JupyterLab?
To both. Notebook 7.6.3 is built from JupyterLab 4.6.4 components and reads the same schema files, so the notebook, editor, search, console and debugger bindings are identical. Notebook 7 adds O to toggle cell outputs and uses Ctrl + B for its scratchpad console, and its notebook page does not register the tab, sidebar and file browser shortcuts of JupyterLab.
Why does a letter key or D, D do nothing in my notebook?
Single-letter shortcuts are bound to command mode only. While the cursor is inside a cell the keys type text, so press Esc first; the same holds for two-key sequences such as D, D and I, I.
Sources and checks
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/application-extension/schema/commands.json Tab, sidebar, fullscreen and layout bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/application-extension/schema/property-inspector.json Property Inspector panel shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/apputils-extension/schema/palette.json Command palette shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/apputils-extension/schema/print.json Print shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/apputils-extension/schema/utilityCommands.json Show Keyboard Shortcuts binding
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/codemirror-extension/schema/plugin.json Code editor bindings
29 more source pages
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/completer-extension/schema/inline-completer.json Inline completion bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/console-extension/schema/completer.json Console completer binding
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/console-extension/schema/tracker.json Console run and line-break bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/debugger-extension/schema/main.json Debugger bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/docmanager-extension/schema/plugin.json Save and Save As
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/documentsearch-extension/schema/plugin.json Find and replace bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/extensionmanager-extension/schema/plugin.json Extension Manager panel shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/filebrowser-extension/schema/browser.json File browser bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/filebrowser-extension/schema/widget.json File browser panel shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/fileeditor-extension/schema/completer.json Text editor completer binding
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/imageviewer-extension/schema/plugin.json Image viewer bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/inspector-extension/schema/inspector.json Contextual Help shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/launcher-extension/schema/plugin.json New Launcher shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/mainmenu-extension/schema/plugin.json Menu bindings: undo, redo, run, kernel interrupt and restart, tabs
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/notebook-extension/schema/completer.json Notebook completer binding
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/notebook-extension/schema/tracker.json Notebook command mode and edit mode bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/running-extension/schema/plugin.json Running sessions panel and search shortcuts
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/settingeditor-extension/schema/plugin.json Settings Editor bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/toc-extension/schema/registry.json Table of Contents panel shortcut
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/tooltip-extension/schema/consoles.json Console tooltip bindings
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/tooltip-extension/schema/files.json Text editor tooltip binding
- JupyterLab 4.6.4 source (tag v4.6.4) — packages/tooltip-extension/schema/notebooks.json Notebook tooltip bindings
- Jupyter Notebook 7.6.3 source (tag v7.6.3) — packages/application-extension/schema/shortcuts.json Notebook 7's own command mode binding (O)
- Jupyter Notebook 7.6.3 source (tag v7.6.3) — packages/console-extension/schema/scratchpad-console.json Notebook 7 scratchpad console shortcut
- JupyterLab 4.6.4 documentation — Commands (command list with default shortcuts) Windows / Linux column of the bindings the schema writes with Accel; command names
- Jupyter Notebook 7.6.3 source (tag v7.6.3) — app/package.json Which JupyterLab plugins each Notebook 7 page loads; dependency on JupyterLab 4.6.4
- JupyterLab 4.6.4 documentation — Common Extension Points: Keyboard Shortcuts Meaning of Accel (Cmd on a Mac, Ctrl on Windows and Linux) and how a selector limits a binding
- JupyterLab 4.6.4 application (PyPI release) — key bindings registered at run time, captured on Linux Bindings added by application code, and the Ctrl form of two bindings the documentation does not print
- Jupyter Notebook 7.6.3 application (PyPI release) — key bindings registered at run time, captured on Linux Scratchpad console shortcut on Windows / Linux; which bindings each Notebook 7 page registers
Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.
Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.