Shortcuts for Jupyter Notebook
After trying my best to learn Jupyter Notebook over the last two-ish weeks, I found that trying to do certain things was a bit of a hassle. Basically I got bored of doing everything manually, so I started looking for the shortcuts that are available in Jupyter Notebook that I could use. Here's a list of almost all of the ones I used and found useful.
Before diving in, it's worth noting that Jupyter Notebook has two modes. These are Command Mode and Edit Mode. There's a small list of shortcuts that can be done in both, so I’ll go over those ones first:
Shift + Enter
Runs the current cell and selects the cell below it.
Ctrl + Enter
Runs the selected cells
Alt + Enter
Runs the current cell, and inserts a cell below it
Ctrl + S
Saves the file
Moving on to the next list of shortcuts, these ones can only be done while you’re in Command Mode, just hit Escape to activate Command Mode.
Up
to select the cell above
Down
to select the cell below
Shift + Up
to extend the selected cells above
Shift + Down
to extend the selected cells below
A
will insert a cell above the currently selected cell
B
will insert a cell below the currently selected cell
X
to cut the selected cells
C
to copy selected cells
V
to paste cells below
Shift + V
to paste cells above
D, D
to delete the selected cells (press D twice)
Z
Undo
S
Saves the file
Y
will change the cell type to Code
M
will change the cell type to Markdown
Finally, the list of shortcuts usable when Edit Mode is active. To activate Edit Mode, just hit Enter.
Tab
for code completion (auto complete) or to indent
Ctrl + ]
to indent
Ctrl + [
to dedent
Ctrl + A
will Select All
Ctrl + Z
Undo
Ctrl + Shift + Z
or Ctrl + Y
redo
Ctrl + Home
to go to cell start
Ctrl + End
to go to cell end
Ctrl + Left
Jump to the end of the previous word
Ctrl + Right
Jump to the end of the next word
That's all the shortcuts I've used so far, and they've come in handy, so hopefully you find them useful too!