Skip to content

Instantly share code, notes, and snippets.

@audreyfeldroy
Last active August 23, 2024 07:07
Show Gist options
  • Save audreyfeldroy/6f5b79f386d2423007c8a3f4ca0a933d to your computer and use it in GitHub Desktop.
Save audreyfeldroy/6f5b79f386d2423007c8a3f4ca0a933d to your computer and use it in GitHub Desktop.
Jupyter nbclassic keyboard shortcuts (copied from nbclassic > H)

Command Mode (press Esc to enable)

F : find and replace

: enter edit mode

⌘⇧F : open the command palette

⌘⇧P : open the command palette

P : open the command palette

⇧↩ : run cell, select below

⌃↩ : run selected cells

⌘↩ : run selected cells

⌥↩ : run cell and insert below

: Collapse the selected heading cell's section

⌃⇧← : Collapse all heading cells' sections

: Un-collapse (expand) the selected heading cell's section

⇧→ : Select all cells in the selected heading cell's section

⌃⇧→ : Un-collapse (expand) all heading cells' sections

⇧A : Insert a heading cell above the selected cell

⇧B : Insert a heading cell below the selected cell's section

Y : change cell to code

M : change cell to markdown

R : change cell to raw

1 : change cell to heading 1

2 : change cell to heading 2

3 : change cell to heading 3

4 : change cell to heading 4

5 : change cell to heading 5

6 : change cell to heading 6

K : select cell above

: select cell above

: select cell below

J : select cell below

⇧K : extend selected cells above

⇧↑ : extend selected cells above

⇧↓ : extend selected cells below

⇧J : extend selected cells below

⌘A : select all cells

A : insert cell above

B : insert cell below

X : cut selected cells

C : copy selected cells

⇧V : paste cells above

V : paste cells below

Z : undo cell deletion

D,D : delete selected cells

⇧M : merge selected cells, or current cell with cell below if only one cell is selected

⌘S : Save and Checkpoint

S : Save and Checkpoint

L : toggle line numbers

O : toggle output of selected cells

⇧O : toggle output scrolling of selected cells

H : show keyboard shortcuts

I,I : interrupt the kernel

0,0 : restart the kernel (with dialog)

⌘V : Dialog for paste from system clipboard

Esc : close the pager

Q : close the pager

⇧L : toggles line numbers in all cells, and persist the setting

⇧␣ : scroll notebook up

: scroll notebook down

Edit Mode (press Enter to enable)

: code completion or indent

⇧⇥ : tooltip

⌘] : indent

⌘[ : dedent

⌘A : select all

⌘Z : undo

⌘/ : comment

⌘D : delete whole line

⌘U : undo selection

Insert : toggle overwrite flag

⌘↑ : go to cell start

⌘↓ : go to cell end

⌥← : go one word left

⌥→ : go one word right

⌥⌫ : delete word before

⌥⌦ : delete word after

⌘⇧Z : redo

⌘⇧U : redo selection

⌃K : emacs-style line kill

⌘⌫ : delete line left of cursor

⌘⌦ : delete line right of cursor

⌃M : enter command mode

Esc : enter command mode

⌘⇧F : open the command palette

⌘⇧P : open the command palette

⇧↩ : run cell, select below

⌃↩ : run selected cells

⌘↩ : run selected cells

⌥↩ : run cell and insert below

⌃⇧Minus : split cell at cursor(s)

⌘S : Save and Checkpoint

: move cursor down

: move cursor up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment