Jupyter notebooks have two different keyboard input modes:

  • Edit mode allows you to enter code or text into a cell and is represented by a green cell
  • Command mode binds the keyboard to note-level commands and displays it through a gray cell border with a blue left border

Mac OS X Shortcuts:

shortcuts role
The command
control
options
Shift
return
The blank space
Tab

Command line mode (Press Esc to take effect)

shortcuts role
F Find and replace
Enter edit mode
⌘ ⇧ F Enabling Command Configuration
⌘ ⇧ P Enabling Command Configuration
P Enabling Command Configuration
⇧ ↩ To run the code block, select the code block below
⌃ ↩ Run the selected code block
⌥ ↩ Run the code block and insert below
Y Turn code blocks into code
M Turn code blocks into tags
R Clear code block format
1 Change the code block to heading 1
2 Change the code block to heading 2
3 Change the code block to heading 3
4 Change the code block to heading 4
5 Change the code block to heading 5
6 Change the code block to heading 6
K Select the code block above
write Select the code block above
left Select the code block below
J Select the code block below
⇧ K. Extend the code block selected above
⇧ write Extend the code block selected above
⇧ left Extend the selected code block below
⇧ J Extend the selected code block below
A Insert code blocks on it
B Insert the code block below
X Cut the selected code block
C Copy the selected code block
⇧ V Paste it on top
V Paste it down here
Z Cancel the delete
D,D Deletes the selected cell
⇧ M Merges selected cells if only one cell is selected
⌘ S Save and check
S Save and check
L Switch the line Numbers
O Select the output of the cell
⇧ O Toggles the output scroll of the selected cell
H Display shortcut keys
I,I Interrupt service
0, 0 Restarting the service (with a window)
Esc Close the page
Q Close the page
⇧ L Toggle line numbers in all cells and leave the Settings
⇧ ␣ Scroll up
Scroll down

Edit mode (Press Enter to take effect)

shortcuts role
Code completion or indentation
⇧ ⇥ The tool tip
⌘] The indentation
⌘ [ dedent
⌘ a. select all
⌘ Z undo
⌘ / comments
⌘ D Delete the entire line
⌘ U Cancel the choice
Insert Toggle override flag
⌘ write Jump to the beginning of the cell
⌘ left Skip to the end of the cell
⌥ please Skip to the left of the word
⌥ – Skip to the right of words
⌥ ⌫ Delete the preceding words
⌥ ⌦ Delete the following words
⌘ ⇧ Z redo
⌘ ⇧ U To choose
⌃ K. emacs-style line kill
⌘ ⌫ Delete the line left of the cursor
⌘ ⌦ delete line right of cursor
⌃ M The CLI is displayed
Esc The CLI is displayed
⌘ ⇧ F Enabling Command Configuration
⌘ ⇧ P Enabling Command Configuration
⇧ ↩ To run the code block, select the code block below
⌃ ↩ Run the selected code block
⌥ ↩ Run the code block and insert below
⌃ ⇧ Minus In the mouse out split code block
⌘ S Save and check
left The cursor down
write The cursor move up