Keyboard shortcuts#

If you know the Jupyter keyboard shortcuts, you can work much more efficiently with notebooks. Jupyter notebooks have two different keyboard input modes:

  • In edit mode you can enter code or text in a cell. This is indicated by a green cell border.

  • Command mode binds the keyboard to notebook-level commands and is indicated by a gray cell border with a blue left border.

Command mode

This mode is available with .

f

find and replace

enter edit mode

--f, --p, p

open the command palette

-

run cell, select below

-, -

run selected cells

-

run cell and insert below

y

change cell to code

m

change cell to markdown

r

change cell to raw

1, 2 etc.

change cell to heading 1, heading 2, etc.

k,

select cell above

j,

select cell below

-k, -

extend selected cells above

-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, 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

, q

close the pager

Edit mode

This mode becomes available with .

code completion or indent

-

tooltip

-]

indent

-[

dedent

-a

select all

-z

undo

-/

comment

-d

delete whole line

-u

undo selection

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

--f, --p

open the command palette

-

run cell, select below

-

run selected cells

-

run selected cells

-

run cell and insert below

---

split cell at cursor(s)

-s

save and checkpoint

move cursor down

move cursor up

Own keyboard shortcuts#

You can also define your own keyboard shortcuts in Help ‣ Edit Keyboard Shortcuts.