Jupyter 简明教程

Jupyter Notebook - Editing

虽然菜单栏和工具栏允许你在笔记本上执行各种操作,但最好能使用键盘快捷键快速执行它们。

Jupyter 笔记本有两个不同的键盘输入模式 −

  1. Command Mode − 将键盘绑定到笔记本级别操作。由带有蓝色左边缘的灰色单元格边框表示。

  2. Edit Mode − 当你正在单元格中输入时。由一个绿色的单元格边框表示。

命令模式(按 Esc 启用)

F

find and replace

1

将单元格更改为标题 1

Ctrl-Shift-F

open the command palette

2

将单元格更改为标题 2

Ctrl-Shift-P

open the command palette

3

将单元格更改为标题 3

Enter

enter edit mode

4

将单元格更改为标题 4

P

open the command palette

5

将单元格更改为标题 5

Shift-Enter

run cell, select below

6

将单元格更改为标题 6

Ctrl-Enter

run selected cells

A

insert cell above

Alt-Enter

运行单元格并插入到下面

B

insert cell below

Y

change cell to code

X

cut selected cells

M

change cell to markdown

C

copy selected cells

R

change cell to raw

V

paste cells below

K

select cell above

Z

undo cell deletion

Up

select cell above

D,D

delete selected cells

Down

select cell below

Shift-M

合并选定的单元格,或仅选择一个单元格时,将当前单元格与下面的单元格合并

J

select cell below

Shift-V

paste cells above

Shift-K

extend selected cells above

L

toggle line numbers

Shift-Up

extend selected cells above

O

切换所选单元格的输出

Shift-Down

extend selected cells below

Shift-O

切换所选单元格的输出滚动

Shift-J

extend selected cells below

I,I

interrupt the kernel

Ctrl-S

Save and Checkpoint

0,0

重新启动内核(带对话框)

S

Save and Checkpoint

Esc

close the pager

Shift-L

切换所有单元格中的行号,并保留设置

Q

close the pager

Shift-Space

scroll notebook up

Space

scroll notebook down

编辑模式(按 Enter 启用)

Tab

code completion or indent

Ctrl-Home

go to cell start

Shift-Tab

tooltip

Ctrl-Up

go to cell start

Ctrl-]

indent

Ctrl-End

go to cell end

Ctrl-[

dedent

Ctrl-Down

go to cell end

Ctrl-A

select all

Ctrl-Left

go one word left

Ctrl-Z

undo

Ctrl-Right

go one word right

Ctrl-/

comment

Ctrl-M

enter command mode

Ctrl-D

delete whole line

Ctrl-Shift-F

open the command palette

Ctrl-U

undo selection

Ctrl-Shift-P

open the command palette

Insert

toggle overwrite flag

Esc

enter command mode

Ctrl-Backspace

delete word before

Ctrl-Y

redo

Ctrl-Delete

delete word after

Alt-U

redo selection

Shift-Enter

run cell, select below

Ctrl-Shift-Minus

split cell at cursor

Ctrl-Enter

run selected cells

Down

move cursor down

Alt-Enter

运行单元格并插入到下面

Up

move cursor up

Ctrl-S

Save and Checkpoint

**