Jupyter notebook 快捷(keyboard shortcut) June 26,2018

这篇博客整理了Jupyter Notebook的常用快捷键,包括Command Mode和Edit Mode下的操作,如Ctrl+Enter运行单元格,Shift+Enter选择下一个单元格,Esc+A在上方插入新单元等。同时介绍了两种模式的功能:绿色边框表示Edit Mode,允许输入代码或文本;灰色边框带蓝色左margin表示Command Mode,用于笔记本级别的操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我将我常用的整理并翻译出来。

Ctrl + /   注释一个单元里的某一行  也可以反注释

Ctrl + Enter 运行本单元

Ctrl + left 跳到左边的字首

shift + enter 运行本单元并选中下一单元

Shift + J 或 Shift + Down 选择下一个cell

Shift + K 或 Shift + Up 选择上一个cell

Shift + M 合并cell. 

shift + tab  提示命令

Esc + F   在代码中查找和替换

Esc + O 在cell和输出结果间切换

Esc + a 在上方插入新单元

Esc + b 在下方插入新单元

Esc + 1- 6 设置标题级别

Esc + ll 显示行数

Esc + Y 代码转入code 代码状态

Esc + M 单元转入 markdown状态

Esc + R 单元转入raw 状态

Alt + enter 运行本单元并在其插入新单元

dd delete code

If you get more keyboard shortcuts,please notice the following content.Thanks for your view.

The Jupyter Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border with a blue left margin.

Command Mode (press Esc to enable)
F: find and replace
Ctrl-Shift-P: open the command palette
Enter: enter edit mode
Shift-Enter: run cell, select below
Ctrl-Enter: run selected cells
Alt-Enter: run cell, insert below
Y: to code
M: to markdown
R: to raw
1: to heading 1
2: to heading 2
3: to heading 3
4: to heading 4
5: to heading 5
6: to heading 6
K: select cell above
Up: select cell above
Down: select cell below
J: select cell below
Shift-K: extend selected cells above
Shift-Up: extend selected cells above
Shift-Down: extend selected cells below
Shift-J: extend selected cells below
A: insert cell above
B: insert cell below
X: cut selected cells
C: copy selected cells
Shift-V: paste cells above
V: paste cells below
Z: undo cell deletion
D,D: delete selected cells
Shift-M: merge selected cells, or current cell with cell below if only one cell selected
Ctrl-S: Save and Checkpoint
S: Save and Checkpoint
L: toggle line numbers
O: toggle output of selected cells
Shift-O: toggle output scrolling of selected cells
H: show keyboard shortcuts
I,I: interrupt kernel
0,0: restart the kernel (with dialog)
Esc: close the pager
Q: close the pager
Shift-Space: scroll notebook up
Space: scroll notebook down
Edit Mode (press Enter to enable)
Tab: code completion or indent
Shift-Tab: tooltip
Ctrl-]: indent
Ctrl-[: dedent
Ctrl-A: select all
Ctrl-Z: undo
Ctrl-Shift-Z: redo
Ctrl-Y: redo
Ctrl-Home: go to cell start
Ctrl-Up: go to cell start
Ctrl-End: go to cell end
Ctrl-Down: go to cell end
Ctrl-Left: go one word left
Ctrl-Right: go one word right
Ctrl-Backspace: delete word before
Ctrl-Delete: delete word after
Ctrl-M: command mode
Ctrl-Shift-P: open the command palette
Esc: command mode
Shift-Enter: run cell, select below
Ctrl-Enter: run selected cells
Alt-Enter: run cell, insert below
Ctrl-Shift-Minus: split cell
Ctrl-S: Save and Checkpoint
Down: move cursor down
Up: move cursor up

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值