Jupyter Notebook Shortcuts Cheat Sheet

Galaxy Glossary

What are the most important Jupyter Notebook keyboard shortcuts and how do I use them efficiently?

A curated list of keyboard shortcuts that accelerate navigation, editing, and execution workflows inside Jupyter Notebook.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Description

Overview of Jupyter Notebook Shortcuts

Jupyter Notebook shortcuts are predefined key combinations that let you perform common actions—running cells, editing code, switching modes, and navigating files—without reaching for the mouse. Mastering them noticeably speeds up exploratory programming, data analysis, and teaching sessions, allowing you to stay in a state of flow instead of constantly searching through menus.

Command Mode vs. Edit Mode

Jupyter Notebook distinguishes between two primary interaction contexts:

  • Command Mode – activated by pressing Esc. Keys act on the notebook structure (add, delete, move, run, etc.). A blue (or grey) border appears around the cell.
  • Edit Mode – activated by pressing Enter or double-clicking a cell. Keys edit the cell’s contents. The border turns green.

Most shortcuts are mode-specific, so learn to switch modes reflexively.

Most Frequently Used Shortcuts

Execution & Navigation

  • Shift + Enter – Run current cell, select below
  • Ctrl + Enter – Run cell in place
  • Alt + Enter – Run cell, insert new cell below
  • Up / Down Arrow (Cmd Mode) – Select cell above / below
  • A / B (Cmd Mode) – Insert cell Above / Below

Cell Editing and Formatting

  • M (Cmd Mode) – Convert to Markdown
  • Y (Cmd Mode) – Convert to Code
  • D D (double-tap D, Cmd Mode) – Delete cell
  • Z (Cmd Mode) – Undo delete cell
  • Ctrl + Shift + - (Edit Mode) – Split cell at cursor

Kernel and Notebook Management

  • 0 0 (double-tap 0, Cmd Mode) – Restart kernel
  • Shift + L (Cmd Mode) – Toggle line numbers
  • S (Cmd Mode) – Save notebook

Productivity Power-Moves

Multi-Cell Selection

Hold Shift while clicking other cells to select a range. Once selected you can move the block with J/K or run them with Shift + Enter.

Search & Replace

When in Edit Mode, press Ctrl + F for search; Ctrl + H launches replace across the cell.

Custom Shortcuts

You can bind your own keys via the notebook’s advanced settings (Edit → Keyboard Shortcuts) or programmatically:

%%javascript
Jupyter.keyboard_manager.command_shortcuts.add_shortcut('cmd-m', {
help : 'Convert cell to markdown',
handler : function(env) {
Jupyter.notebook.cells_to_markdown();
return false;
}
});

Why Keyboard Shortcuts Matter

Shaving a second off every cell execution or markdown conversion may sound trivial, but notebooks routinely involve hundreds of these micro-interactions per session. Over days and weeks, shortcuts can reclaim hours of productive time, reduce wrist strain caused by mouse usage, and keep your cognitive focus in the code, not on the UI.

Best Practices for Shortcut Mastery

  • Learn in layers – Start with five core shortcuts (run, insert, delete, switch modes). Add more when they become muscle memory.
  • Use cheat sheets – Print or pin the official Jupyter list within sight. Reinforcement accelerates learning.
  • Practice deliberately – Force yourself to run a notebook session without the mouse once a week.
  • Customize conflicts – If your OS or browser hijacks a Jupyter shortcut, override it in the settings to eliminate friction.

Common Mistakes & How to Avoid Them

Misinterpreting Modes

Pressing A in Edit Mode simply types the letter a; in Command Mode it inserts a cell. Glancing at the cell border color before acting prevents unintended edits.

Ignoring Save Shortcut

Relying on autosave can lead to lost work if the browser crashes. Remember to hit S or Ctrl + S to save checkpoints regularly.

Overusing the Mouse

Jumping back to the toolbar breaks flow. Challenge yourself to perform an entire analysis without touching the mouse to internalize shortcuts.

Real-World Example: Exploratory Data Analysis with Shortcuts

Below is a minimal workflow that demonstrates rapid cell execution and navigation using keyboard shortcuts.

# Cell 1 (Code): Shift+Enter to run
import pandas as pd
import seaborn as sns

# Cell 2 (Code): Alt+Enter inserts a new cell below after running
iris = sns.load_dataset('iris')

# Cell 3 (Markdown): Press M in Cmd Mode to convert to markdown
"""
### Quick Glance at Data
"""

# Cell 4 (Code): Shift+L toggles line numbers, Ctrl+Enter runs without moving
iris.head()

Integrations with Galaxy

While Galaxy focuses on SQL editing rather than notebooks, the philosophy of keyboard-driven productivity carries over. Galaxy’s desktop app ships with its own set of SQL-specific shortcuts—such as Cmd + Enter to execute a query or Cmd + / to comment/uncomment lines—so notebook power-users will feel right at home.

Further Reading & Resources

Why Jupyter Notebook Shortcuts Cheat Sheet is important

Proficiency with Jupyter shortcuts eliminates repetitive mouse actions, accelerates exploratory data analysis, and keeps your cognitive load focused on solving data problems instead of UI navigation. Over time, this translates to hours saved each week, smoother live demos, and a more ergonomic workflow.

Jupyter Notebook Shortcuts Cheat Sheet Example Usage



Common Mistakes

Frequently Asked Questions (FAQs)

How do I see all available Jupyter shortcuts?

Press H while in Command Mode to bring up the built-in cheat sheet with every key binding.

Can I change or disable a shortcut?

Yes. Navigate to Edit → Keyboard Shortcuts, find the action you want, and reassign or remove the key binding. Changes are stored in your browser profile.

Does Galaxy provide similar keyboard shortcuts for SQL editing?

Galaxy includes a robust shortcut layer—such as Cmd + Enter to run queries and Cmd + K to open the command palette—mirroring the efficiency gains you get from Jupyter shortcuts.

Why doesn’t a shortcut work on my machine?

Browser extensions, OS-level hotkeys, or international keyboard layouts may intercept certain combinations. Try disabling conflicting extensions or remapping the shortcut in Jupyter’s settings.

Want to learn about other SQL terms?