A curated list of the most productive keyboard shortcuts in Jupyter Notebook that accelerate coding, navigation, and collaboration.
Jupyter Notebook (and its modern successor JupyterLab) is the de-facto interactive environment for Python, R, and Julia. While its GUI encourages quick experimentation, relying solely on the mouse slows you down. Mastering built-in keyboard shortcuts lets you run cells, refactor code, navigate large notebooks, and manage kernels at the speed of thought. This article catalogs the most useful default shortcuts, explains how they work, and offers best practices for customizing them.
Jupyter uses two interaction modes:
Esc
): Notebook-level actions such as adding, deleting, moving, and running cells.Enter
or clicking inside a cell): Classic editor behavior for writing code or Markdown.The same letter keys trigger different actions depending on the mode, so always note the blue (command) or green (edit) cell border.
Shift + Enter
: Run selected cell and move to the next (the single most used shortcut).Ctrl + Enter
: Run selected cell and stay.Alt + Enter
: Run selected cell and insert a new cell below—great for rapid prototyping.Up / Down
: Move cursor between cells without entering edit mode.A
: Insert cell above.B
: Insert cell below.D D
(press D
twice): Delete selected cell(s).Shift + M
: Merge selected cells.Y
: Change cell type to Code
.M
: Change cell type to Markdown
.Ctrl + Shift + P
: Open the command palette (JupyterLab) for fuzzy-searchable actions.0 0
: Restart the kernel (press zero twice).S
: Save and create a checkpoint.Ctrl + ←/→
: Jump by word.Ctrl + Shift + ←/→
: Select by word.Home / End
: Jump to line start/end.Tab
: Trigger context-aware autocompletion via IPython.Shift + Tab
: Show docstring tooltip; press four times for ??
full source view.Ctrl + /
: Toggle comment for selected lines.Ctrl + Shift + −
: Split cell at cursor position.Ctrl + Click
(or Alt + Click
on some OSes): Add a new cursor and type simultaneously on multiple lines—ideal for mass refactors.Ctrl + L
: Select current line; continue pressing to extend selection.Combine Shift + Tab
with Ctrl + Enter
to explore an unfamiliar library without leaving the cell.
Use Esc
→ X
to cut a broken cell, paste it below (V
), then add print statements. This keeps the notebook history clean while you iterate.
Jupyter lets you override defaults via the JSON-based ~/.jupyter/nbconfig/notebook.json
file or the graphical interface (Help → Keyboard Shortcuts). For example, to rebind “Insert cell below” to Ctrl + I
:
{
"keys": ["Ctrl I"],
"command": "notebook:insert-cell-below"
}
After saving, refresh the browser tab to activate changes.
Install the jupyterlab-vim
or jupyterlab-emacskeys
extensions for modal editing. These merge native editor muscle memory with notebook-specific commands.
Modern SQL IDEs like Galaxy borrow heavily from Jupyter’s shortcut philosophy—zero latency context switches. While Galaxy targets SQL rather than Python, its AI Copilot and command palette map to similar key combos (Ctrl + Enter
to run, Cmd + K
to open the palette on macOS). Mastering Jupyter shortcuts primes you to be productive in Galaxy’s desktop app as well.
Shift + Enter
, Y
, M
, A
, B
, D D
, S
, Ctrl +/
, Shift + Tab
, 0 0
) first.S
) before risky operations like restarting kernels.nbconfig
.Ctrl + W
) override some keys; test before relying.Keyboard shortcuts turn Jupyter from a click-driven scratchpad into a professional IDE. They minimize context switching, accelerate exploratory analysis, and prepare you for productivity in adjacent tools like Galaxy. Invest an hour in practice today; save hundreds over your next project.
Data scientists and engineers spend countless hours inside Jupyter. Mastering shortcuts removes friction, enabling faster iteration, clearer notebooks, and less mental fatigue. The productivity gains compound across exploratory analysis, machine-learning pipelines, and presentation-ready reports.
Press H
in Command mode or open Help → Keyboard Shortcuts to display a searchable list. In JupyterLab, use Ctrl + Shift + P
and type “shortcuts”.
Yes. Navigate to Settings → Advanced Settings Editor → Keyboard Shortcuts in JupyterLab, or edit ~/.jupyter/nbconfig/notebook.json
for classic Notebook. Provide the new key sequence or remove the binding.
Galaxy’s desktop SQL editor mirrors several Jupyter-style combos—Ctrl + Enter
runs the current query, Cmd + K
opens its command palette, and Alt + Shift + Down
duplicates lines. Mastering Jupyter shortcuts will make Galaxy feel instantly familiar.
IPython 7.0+ supports %debug
magics. Run a failing cell, then execute %debug
in a new one to inspect the stack. Use arrow keys and n
/c
commands inside the debugger.