JupyterLab keyboard shortcuts
JupyterLab is the notebook interface from Project Jupyter. In command mode (Esc) single keys add, delete and change cells; in edit mode (Enter) you type in the cell. Jupyter Notebook 7 uses the same keys.
Most used JupyterLab keyboard shortcuts
The JupyterLab shortcuts worth learning first. The full list follows, grouped by task.
- Run the cell and select the nextMacShiftEnterWindowsShiftEnterLinuxShiftEnter
- Run the cell and stayMacCmdEnterorCtrlEnterWindowsCtrlEnterLinuxCtrlEnter
- Enter command modeMacEscWindowsEscLinuxEsc
- Enter edit modeMacEnterWindowsEnterLinuxEnter
- Insert a cell belowMacBWindowsBLinuxB
- Insert a cell aboveMacAWindowsALinuxA
- Delete the cellMacD,DWindowsD,DLinuxD,D
- Change the cell to MarkdownMacMWindowsMLinuxM
- Change the cell to codeMacYWindowsYLinuxY
- Open the command paletteMacShiftCmdCWindowsCtrlShiftCLinuxCtrlShiftC
- Restart the kernelMac0,0Windows0,0Linux0,0
- Interrupt the kernelMacI,IWindowsI,ILinuxI,I
Running cells
5 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Run the cell and select the next | ShiftEnter | ShiftEnter | ShiftEnter |
| Run the cell and stay | CmdEnterorCtrlEnter | CtrlEnter | CtrlEnter |
| Run the cell and insert one below | OptionEnter | AltEnter | AltEnter |
| Interrupt the kernelCommand mode | I,I | I,I | I,I |
| Restart the kernelCommand mode | 0,0 | 0,0 | 0,0 |
Modes
2 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Enter command modeEdit mode | Esc | Esc | Esc |
| Enter edit modeCommand mode | Enter | Enter | Enter |
Cells (command mode)
20 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Insert a cell aboveCommand mode | A | A | A |
| Insert a cell belowCommand mode | B | B | B |
| Delete the cellCommand mode | D,D | D,D | D,D |
| Cut the cellCommand mode | X | X | X |
| Copy the cellCommand mode | C | C | C |
| Paste the cell belowCommand mode | V | V | V |
| Paste the cell aboveCommand mode | ShiftV | ShiftV | ShiftV |
| Undo the cell operationCommand mode | Z | Z | Z |
| Redo the cell operationCommand mode | ShiftZ | ShiftZ | ShiftZ |
| Merge the selected cellsCommand mode | ShiftM | ShiftM | ShiftM |
| Change the cell to MarkdownCommand mode | M | M | M |
| Change the cell to codeCommand mode | Y | Y | Y |
| Change the cell to rawCommand mode | R | R | R |
| Make the cell a level 1 headingCommand mode | 1 | 1 | 1 |
| Make the cell a level 2 headingCommand mode | 2 | 2 | 2 |
| Select the cell aboveCommand mode | ↑orK | ↑orK | ↑orK |
| Select the cell belowCommand mode | ↓orJ | ↓orJ | ↓orJ |
| Extend the selection upCommand mode | Shift↑orShiftK | Shift↑orShiftK | Shift↑orShiftK |
| Extend the selection downCommand mode | Shift↓orShiftJ | Shift↓orShiftJ | Shift↓orShiftJ |
| Show or hide line numbersCommand mode | ShiftL | ShiftL | ShiftL |
Editing (edit mode)
4 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Complete the codeEdit mode | Tab | Tab | Tab |
| Show the docstring tooltipEdit mode | ShiftTab | ShiftTab | ShiftTab |
| Comment or uncommentEdit mode | Cmd/ | Ctrl/ | Ctrl/ |
| Split the cell at the cursorEdit mode | ShiftCmd- | CtrlShift- | CtrlShift- |
Interface
8 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Open the command palette | ShiftCmdC | CtrlShiftC | CtrlShiftC |
| Save the notebook | CmdS | CtrlS | CtrlS |
| Show or hide the left sidebar | CmdB | CtrlB | CtrlB |
| Show the file browser | ShiftCmdF | CtrlShiftF | CtrlShiftF |
| Toggle Simple Interface (one document) | ShiftCmdD | CtrlShiftD | CtrlShiftD |
| Close the tab | OptionW | AltW | AltW |
| Next tab | ShiftCmd] | CtrlShift] | CtrlShift] |
| Previous tab | ShiftCmd[ | CtrlShift[ | CtrlShift[ |
No shortcuts match. Try fewer words, the key names only, or search every app.
Show the key map: which keys JupyterLab uses mostDarker orange = used by more shortcuts
Insert, delete, move and convert cells in JupyterLab
These work in command mode: press Esc first so the cell has a blue bar and no cursor.
- Cut the cellMacXWindowsXLinuxX
- Copy the cellMacCWindowsCLinuxC
- Paste the cell belowMacVWindowsVLinuxV
- Paste the cell aboveMacShiftVWindowsShiftVLinuxShiftV
- Undo the cell operationMacZWindowsZLinuxZ
- Redo the cell operationMacShiftZWindowsShiftZLinuxShiftZ
- Merge the selected cellsMacShiftMWindowsShiftMLinuxShiftM
- Change the cell to rawMacRWindowsRLinuxR
- Make the cell a level 1 headingMac1Windows1Linux1
- Make the cell a level 2 headingMac2Windows2Linux2
- Select the cell aboveMac↑orKWindows↑orKLinux↑orK
- Select the cell belowMac↓orJWindows↓orJLinux↓orJ
- Extend the selection upMacShift↑orShiftKWindowsShift↑orShiftKLinuxShift↑orShiftK
- Extend the selection downMacShift↓orShiftJWindowsShift↓orShiftJLinuxShift↓orShiftJ
- Show or hide line numbersMacShiftLWindowsShiftLLinuxShiftL
- Run all cells
- Run > Run All Cells has no default key; give it one in Settings > Settings Editor > Keyboard Shortcuts.
Comment, complete and split code in JupyterLab
- Complete the codeMacTabWindowsTabLinuxTab
- Show the docstring tooltipMacShiftTabWindowsShiftTabLinuxShiftTab
- Split the cell at the cursorMacShiftCmd-WindowsCtrlShift-LinuxCtrlShift-
Kernel, sidebar and tab shortcuts in JupyterLab
- Save the notebookMacCmdSWindowsCtrlSLinuxCtrlS
- Show or hide the left sidebarMacCmdBWindowsCtrlBLinuxCtrlB
- Show the file browserMacShiftCmdFWindowsCtrlShiftFLinuxCtrlShiftF
- Toggle Simple Interface (one document)MacShiftCmdDWindowsCtrlShiftDLinuxCtrlShiftD
- Close the tabMacOptionWWindowsAltWLinuxAltW
- Next tabMacShiftCmd]WindowsCtrlShift]LinuxCtrlShift]
- Previous tabMacShiftCmd[WindowsCtrlShift[LinuxCtrlShift[
JupyterLab keyboard shortcuts: questions
- What is the difference between command mode and edit mode in Jupyter?
- In edit mode (press Enter) keys type into the cell. In command mode (press Esc) single keys act on whole cells: A and B add cells, D D deletes, M makes Markdown and Y makes code.
- How do I change JupyterLab keyboard shortcuts?
- Open Settings > Settings Editor > Keyboard Shortcuts, find the command and add or change its keys. In older versions, use the JSON Settings Editor and add an entry under shortcuts.
- How do I start JupyterLab from the command line?
- Run jupyter lab in a terminal; it opens in your browser. Install it first with pip install jupyterlab if the command is not found.
These are the default key bindings in JupyterLab 4.4, as published by Project Jupyter. Shortcuts that need an extension, an add-in or a changed keymap are left out. Where two combinations do the same thing, both are shown.
Single-system lists: JupyterLab keyboard shortcuts for Mac, JupyterLab keyboard shortcuts for Windows, JupyterLab keyboard shortcuts for Linux.
Each shortcut has its own page with the keys for every system, related shortcuts and the same action in other apps. The printable cheat sheet fits the whole list on one or two pages.