Appendix F — Jupyter Shortcut Keys

Using Jupyter efficiently requires learning the short-cut keys.1

1 This is actually true of almost any piece of software. If you are the mouse to navigate menus instead of using ctrl-c/x/v/z/y/a/s/w/t/f/b/i/o/p/e/r then you are wasting years of your life for no reason!

Shortcut keys when in Command Mode (Blue)

Shortcut What Happens
h Shows a pop-up window listing out all keyboard shortcuts
ctrl + shift + p (Win) Shows the Command Palette
enter Goes into Edit Mode (green) for the currently selected cell
ctrl + enter Runs the selected cell
shift + enter Runs the selected cell; Selects the cell below
alt + enter (Win) Runs the selected cell; Adds a new cell below; Enters the new cell in Edit Mode
A Inserts a new cell above the currently-selected cell
B Inserts a new cell below the currently-selected cell
C Copies the currently-selected cell(s)
V Pastes a cell(s) that have been C Copied as new cell(s) below the currently-selected cell
shift + V Pastes a cell(s) that have been C Copied as new cell(s) above the currently-selected cell
D D (the ‘D’ key twice) Deletes the currently selected cell(s)
Shift + Click Cell Highlights the range of cells between the one that was selected, and the one that you clicked…just like Shift-Clicking a series of files
Shift + M Merges any highlighted cells that had been Shift-Clicked; If only one cell is selected, it merges the selected cell with the cell directly below
M Changes the cell’s type to Markdown; If the cell is run, it will be executed as Markdown and the output will be formatted and shown; Helpful for providing documentation in the notebook
Y Changes the cell’s type to Code; If the cell is run, it will be executed as code and the output displayed below the cell
Shortcut keys when in Edit Mode (Green)

Shortcut What Happens
esc Goes back to Command Mode (Blue)
ctrl + shift + p (Win) Shows the Command Palette
ctrl + enter Runs the selected cell
shift + enter Runs the selected cell; Selects the cell below
alt + enter (Win) Runs the selected cell; Adds a new cell below; Enters the new cell in Edit Mode
ctrl + click (Win) Creates multiple cursors for multi-cursor editing
ctrl + / (Win) Toggles whether or not the line(s) of code are commented out or not
tab Engages code completion if you’re typing code; Indents the line of code if you’re at the beginning of a line
shift + tab Displays a tooltip if you’re typing code; helpful for referencing function parameters
ctrl + shift + - Splits the cell into two cells where your cursor is located