HomeBooks

En

Chapter 1
§1.0 Running Python
§1.3 Basic Jupyter Notebook Operations
KM
bykarutt

2025-06-03

Jupyter Notebook offers many keyboard shortcuts to make running code and managing cells smoother.

Edit Mode vs. Command Mode

Jupyter Notebook has two modes. Knowing which mode you're in helps you use shortcuts correctly.

  • Command Mode
    • Lets you add, delete, or move cells.
    • Press Esc to switch from edit mode.
    • The cursor disappears from the cell, and the whole cell is selected.
  • Edit Mode
    • Lets you type and edit inside a cell.
    • Click a cell or press Enter to enter edit mode.
    • The cursor appears inside the cell, ready for input.

Main Shortcuts for Both Modes

ShortcutAction
Ctrl + EnterRun the cell and stay in the same cell

Main Shortcuts in Command Mode

ShortcutAction
AAdd a cell above
BAdd a cell below
XDelete the selected cell
MConvert to Markdown cell

Main Shortcuts in Edit Mode

ShortcutAction
Ctrl + [Decrease indent
Ctrl + ]Increase indent
Ctrl + /Comment/uncomment the line
Ctrl + ZUndo last action
Ctrl + Shift + ZRedo last action
Ctrl + ASelect all in the cell
Ctrl + CCopy selected text
Ctrl + VPaste copied text

Tips for Switching Modes

  • Edit → Command: Press Esc
  • Command → Edit: Click inside the cell
  • If shortcuts don't work, check your mode!
Prev
§1.2 Let's Try Jupyter Notebook