Jupyter Notebook基础(5)快捷键说明、快捷键设置

Jupyter Notebook快捷键说明

Jupyter Notebook编辑器有两种不同的键盘输入模式。即命令模式和编辑模式,这与 Vim 有些类似。在编辑模式下,可以在单元格中输入代码或文本,此时单元格被绿色的框线包围,且命令模式下的快捷键不生效。在命令模式下,可以用快捷键命令运行单元格,移动单元格,切换单元格编辑状态等等,此时的单元格被灰色的框线包围,且编辑模式下的快捷键不生效。

命令模式(按 Esc 生效)

快捷键说明1说明2
Ffind and replace查找并且替换
Ctrl-Shift-Fopen the command palette打开命令配置
Ctrl-Shift-Popen the command palette打开命令配置
Enterenter edit mode进入编辑模式
Popen the command palette打开命令配置
Shift-Enterrun cell, select below运行代码块, 选择下面的代码块
Ctrl-Enterrun selected cells运行选中的代码块
Alt-Enterrun cell and insert below运行代码块并且在下面插入代码块
Ychange cell to code把代码块变成代码
Mchange cell to markdown把代码块变成 Markdown
Rchange cell to raw清除代码块格式
1change cell to heading 1把代码块变成标题 1
2change cell to heading 2把代码块变成标题 2
3change cell to heading 3把代码块变成标题 3
4change cell to heading 4把代码块变成标题 4
5change cell to heading 5把代码块变成标题 5
6change cell to heading 6把代码块变成标题 6
Kselect cell above选择上面的代码块
select cell above选择上面的代码块
select cell below选择下面的代码块
Jselect cell below选择下面的代码块
Shift-Kextend selected cells above扩展上面选择的代码块
Shift-上extend selected cells above扩展上面选择的代码块
Shift-下extend selected cells below扩展下面选择的代码块
Shift-Jextend selected cells below扩展下面选择的代码块
Ctrl-Aselect all cellsselect all cells
Ainsert cell above在上面插入代码块
Binsert cell below在下面插入代码块
Xcut selected cells剪切选择的代码块
Ccopy selected cells复制选择的代码块
Shift-Vpaste cells above粘贴到上面
Vpaste cells below粘贴到下面
Zundo cell deletion撤销删除
D,Ddelete selected cells删除选中单元格
Shift-Mmerge selected cells, or current cell with cell below if only one cell is selected合并选中单元格, 如果只有一个单元格被选中
Ctrl-SSave and Checkpoint保存并建立检查点
SSave and Checkpoint保存并建立检查点
Ltoggle line numbers切换行号
Otoggle output of selected cells切换选定单元格的输出
Shift-Otoggle output scrolling of selected cells切换选中单元格的输出滚动
Hshow keyboard shortcuts显示键盘快捷键
I,Iinterrupt the kernel中断内核
0,0restart the kernel (with dialog)重启内核(带确认对话框)
Escclose the pager关闭分页器
Qclose the pager关闭分页器
Shift-Ltoggles line numbers in all cells, and persist the setting在所有单元格中切换行号,并保持设置
Shift-空格scroll notebook up向上滚动
空格scroll notebook down向下滚动

编辑模式(按 Enter 生效)

快捷键说明1说明2
Tabcode completion or indent代码补全或缩进
Shift-Tabtooltip工具提示
Ctrl-]indent缩进
Ctrl-[dedent取消缩进
Ctrl-Aselect all全选
Ctrl-Zundo撤销
Ctrl-/comment注释
Ctrl-Ddelete whole line删除整行
Ctrl-Uundo selection撤销选择
Inserttoggle overwrite flag切换重写标志
Ctrl-Homego to cell start跳到单元格起始处
Ctrl-Upgo to cell start跳到单元格起始处
Ctrl-Endgo to cell end跳到单元格最后
Ctrl-Downgo to cell end跳到单元格最后
Ctrl-Leftgo one word left往左跳一个单词
Ctrl-Rightgo one word right往右跳一个单词
Ctrl-Backspacedelete word before删除前面的单词
Ctrl-Deletedelete word after删除后面的单词
Ctrl-Yredo重做
Alt-Uredo selection重新选择
Ctrl-Menter command mode进入命令行模式
Ctrl-Shift-Fopen the command palette打开命令配置
Ctrl-Shift-Popen the command palette打开命令配置
Escenter command mode进入命令行模式
Shift-Enterrun cell, select below运行代码块, 选择下面的代码块
Ctrl-Enterrun selected cells运行选中的代码块
Alt-Enterrun cell and insert below运行代码块并且在下面插入代码块
Ctrl-Shift-Minussplit cell at cursor在光标处分割单元格
Ctrl-SSave and Checkpoint保存并建立检查点
Downmove cursor down光标下移
Upmove cursor up光标上移
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值