命令#

命令是触发用户界面操作的入口点。它们与菜单项、键盘快捷键、启动器和命令面板相关联。

命令具有唯一的ID,用于引用或执行它。它可能还需要输入参数。这些参数在命令面板和键盘快捷键中可能有所不同。这可以解释根据命令触发源的不同行为。

Markdown文件中的命令#

JupyterLab 支持在 Markdown 文件中使用以下语法的命令:

`<button data-commandLinker-command="help:about" href="#">TEST</button>`

data-commandLinker-command 的值必须是一个有效的命令标识符(见下面的列表)。

这允许你在Markdown文档中嵌入带有自定义命令的按钮或其他元素。

命令面板#

JupyterLab 中的所有用户操作都通过一个集中式的命令系统处理。这些命令在整个 JupyterLab 中共享和使用(菜单栏、上下文菜单、键盘快捷键等)。命令面板提供了一种通过键盘驱动的方式来搜索和运行 JupyterLab 命令:

命令面板可以从视图菜单中访问,或者使用键盘快捷键 Command/Ctrl Shift C

命令面板可以通过在设置中添加'modal': false来显示在侧边栏中。

命令列表#

下表显示了命令列表及其相关的键盘快捷键。如果您想自定义菜单、工具栏或键盘快捷键,唯一标识符非常有用。

注意

在Mac OS上,Ctrl键应替换为Cmd

命令ID

标签

快捷方式

application:activate-next-tab

激活下一个标签页

Ctrl Shift ]

application:activate-next-tab-bar

激活下一个标签栏

Ctrl Shift .

application:activate-previous-tab

激活上一个标签页

Ctrl Shift [

application:activate-previous-tab-bar

激活上一个标签栏

Ctrl Shift ,

application:close

关闭标签页

Alt W

application:close-all

关闭所有标签页

application:close-other-tabs

关闭所有其他标签页

application:close-right-tabs

关闭右侧标签页

application:reset-layout

重置默认布局

application:set-mode

设置布局mode

application:toggle-fullscreen-mode

全屏模式

F11

application:toggle-header

显示标题

application:toggle-left-area

显示左侧边栏

Ctrl B

application:toggle-mode

简单界面

Ctrl Shift D

application:toggle-presentation-mode

演示模式

application:toggle-right-area

显示右侧边栏

Ctrl J

application:toggle-side-tabbar

显示左侧活动栏

application:toggle-sidebar-widget

切换侧边栏元素

Alt 1

apputils:activate-command-palette

激活命令面板

Ctrl Shift C

apputils:adaptive-theme

与系统设置同步

apputils:change-dark-theme

切换到提供的深色主题

apputils:change-font

等待字体

apputils:change-light-theme

切换到提供的浅色主题

apputils:change-theme

切换到提供的theme

apputils:decr-font-size

减小字体大小

apputils:dismiss-notification

关闭通知

apputils:display-notifications

显示通知

apputils:display-shortcuts

显示键盘快捷键…

Ctrl Shift H

apputils:incr-font-size

增大字体大小

apputils:load-statedb

加载当前工作区的状态。

apputils:notify

发出通知

apputils:print

打印…

Ctrl P

apputils:reset

重置应用程序状态

apputils:reset-on-load

加载工作区时重置状态。

apputils:run-all-enabled

运行所有作为参数传递的已启用命令

apputils:run-first-enabled

运行首个启用的命令

apputils:theme-scrollbars

主题滚动条

apputils:toggle-header

在内容上方显示标题

apputils:update-notification

更新通知

code-viewer:open

打开代码查看器

codemirror:delete-line

删除当前行

Ctrl D

codemirror:select-next-occurrence

选择下一个出现

Ctrl Shift D

codemirror:toggle-block-comment

切换块注释

Alt A

codemirror:toggle-comment

切换评论

Ctrl /

completer:invoke-console

显示完成助手。

Tab

completer:invoke-file

显示完成助手。

Tab

completer:invoke-notebook

显示完成助手。

Tab

completer:select-console

选择完成建议。

输入

completer:select-file

选择完成建议。

输入

completer:select-notebook

选择完成建议。

输入

console:change-kernel

更改内核…

console:clear

清除控制台单元格

console:close-and-shutdown

关闭并关机…

console:create

控制台

console:get-kernel

获取内核

console:inject

在控制台中注入一些代码。

console:interaction-mode

设置控制台交互模式。

console:interrupt-kernel

中断内核

console:linebreak

插入换行符

Ctrl Enter

console:open

为提供的path打开一个控制台。

console:redo

重做

console:replace-selection

在控制台中替换选择

console:restart-kernel

重启内核…

console:run-forced

运行单元格(强制)

Shift Enter

console:run-unforced

运行单元格(非强制)

输入

console:shutdown

关闭

console:toggle-autoclosing-brackets

代码控制台提示的自动关闭括号

console:toggle-show-all-kernel-activity

显示所有内核活动

console:undo

撤销

csv:go-to-line

转到行

debugger:continue

暂停

F9

debugger:copy-to-clipboard

复制到剪贴板

debugger:copy-to-globals

复制变量到全局变量

debugger:evaluate

评估代码

debugger:inspect-variable

检查变量

debugger:next

下一步

F10

debugger:open-source

开源

debugger:pause-on-exceptions

异常断点

debugger:render-mime-variable

渲染变量

debugger:restart-debug

重启内核并调试…

debugger:show-panel

调试器面板

Ctrl Shift E

debugger:stepIn

步入

F11

debugger:stepOut

退出

Shift F11

debugger:terminate

终止

Shift F9

docmanager:clear-recents

清除最近文档

docmanager:clone

新视图用于

docmanager:delete

删除

docmanager:delete-file

删除

docmanager:download

下载

docmanager:duplicate

重复

docmanager:new-untitled

新的未定义

docmanager:open

打开提供的 path

docmanager:open-browser-tab

在新浏览器标签页中打开

docmanager:reload

从磁盘重新加载

docmanager:rename

重命名…

docmanager:restore-checkpoint

恢复到检查点…

docmanager:save

保存

Ctrl S

docmanager:save-all

保存全部

docmanager:save-as

另存为…

Ctrl Shift S

docmanager:show-in-file-browser

在文件浏览器中显示

docmanager:toggle-autosave

自动保存文档

documentsearch:end

结束搜索

退出

documentsearch:highlightNext

查找下一个

Ctrl G

documentsearch:highlightPrevious

查找上一个

Ctrl Shift G

documentsearch:start

查找…

Ctrl F

documentsearch:startWithReplace

查找和替换…

documentsearch:toggleSearchInSelection

在选定内容中搜索

Alt L

editmenu:clear-all

清除全部

editmenu:clear-current

清除

editmenu:go-to-line

转到行…

editmenu:open

打开编辑菜单

editmenu:redo

重做

Ctrl Shift Z

editmenu:undo

撤销

Ctrl Z

extensionmanager:show-panel

扩展管理器

Ctrl Shift X

extensionmanager:toggle

启用扩展管理器

filebrowser:activate

打开文件浏览器以访问提供的 path

filebrowser:copy

复制

Ctrl C

filebrowser:copy-download-link

复制下载链接

filebrowser:copy-path

复制路径

filebrowser:create-new-directory

新建文件夹

filebrowser:create-new-file

新文件

filebrowser:create-new-markdown-file

新建Markdown文件

filebrowser:cut

剪切

Ctrl X

filebrowser:delete

删除

删除

filebrowser:download

下载

filebrowser:duplicate

重复

Ctrl D

filebrowser:go-to-path

更新文件浏览器以显示提供的 path

filebrowser:go-up

上升

退格键

filebrowser:hide-main

隐藏文件浏览器。

filebrowser:open

打开

filebrowser:open-browser-tab

在新浏览器标签页中打开

filebrowser:open-path

从路径打开…

filebrowser:open-url

从URL打开…

filebrowser:paste

粘贴

Ctrl V

filebrowser:refresh

刷新文件列表

filebrowser:rename

重命名

F2

filebrowser:search

搜索文件名

filebrowser:share-main

复制可分享链接

filebrowser:shutdown

关闭内核

filebrowser:toggle-file-checkboxes

显示文件复选框

filebrowser:toggle-file-filter

切换文件过滤器

filebrowser:toggle-file-size

显示文件大小列

filebrowser:toggle-hidden-files

显示隐藏文件

filebrowser:toggle-last-modified

显示最后修改的列

filebrowser:toggle-main

文件浏览器

Ctrl Shift F

filebrowser:toggle-navigate-to-current-directory

在文件浏览器中显示活动文件

filebrowser:toggle-show-full-path

显示完整路径

filebrowser:toggle-single-click-navigation

启用单次点击导航

filebrowser:toggle-sort-notebooks-first

将笔记本排序在文件之上

fileeditor:change-font-size

减小字体大小

fileeditor:change-language

更改编辑器语言。

fileeditor:change-tabs

使用Tab键缩进

fileeditor:change-theme

jupyter

fileeditor:copy

复制

fileeditor:create-console

为编辑器创建控制台

fileeditor:create-new

文本文件

fileeditor:create-new-markdown-file

Markdown 文件

fileeditor:cut

剪切

fileeditor:find

查找…

fileeditor:go-to-line

转到行…

fileeditor:markdown-preview

显示Markdown预览

fileeditor:paste

粘贴

fileeditor:redo

重做

fileeditor:replace-selection

替换编辑器中的选择

fileeditor:restart-console

重启内核

fileeditor:run-all

运行所有代码

fileeditor:run-code

运行选定的代码

fileeditor:select-all

全选

fileeditor:toggle-autoclosing-brackets

文本编辑器中的自动关闭括号

fileeditor:toggle-autoclosing-brackets-universal

自动关闭括号

fileeditor:toggle-current-line-numbers

显示行号

fileeditor:toggle-current-line-wrap

换行

fileeditor:toggle-current-match-brackets

匹配括号

fileeditor:toggle-line-numbers

显示行号

fileeditor:toggle-line-wrap

自动换行

fileeditor:toggle-match-brackets

匹配括号

fileeditor:undo

撤销

filemenu:close-and-cleanup

关闭并关机

Ctrl Shift Q

filemenu:create-console

活动的新控制台

filemenu:logout

登出

filemenu:open

打开文件菜单

filemenu:shutdown

关闭

help:about

关于 JupyterLab

帮助:jupyter论坛

Jupyter 论坛

帮助:许可证报告

下载所有许可证为Markdown格式

帮助:许可证

许可证

帮助:许可证刷新

刷新许可证

help:open

在标签页中打开提供的 url

helpmenu:get-kernel

获取内核

helpmenu:open

打开帮助菜单

htmlviewer:trust-html

信任HTML文件

imageviewer:flip-horizontal

水平翻转图像

H

imageviewer:flip-vertical

垂直翻转图像

V

imageviewer:invert-colors

反色

imageviewer:reset-image

重置图像

0

imageviewer:rotate-clockwise

顺时针旋转

]

imageviewer:rotate-counterclockwise

逆时针旋转

[

imageviewer:zoom-in

放大

=

imageviewer:zoom-out

缩小

-

inline-completer:accept

接受内联完成

Tab

inline-completer:invoke

调用内联补全器

Alt

inline-completer:next

下一个内联完成

Alt ]

inline-completer:previous

上一个内联完成

Alt [

inspector:close

隐藏上下文帮助

Ctrl I

inspector:open

显示上下文帮助

Ctrl I

inspector:toggle

显示上下文帮助

jupyterlab-translation:en

英语

jupyterlab-translation:zh_CN

Chinese (Simplified, China) - 中文 (简体, 中国)

kernelmenu:change

更改内核…

kernelmenu:interrupt

中断内核

I, I

kernelmenu:open

打开内核菜单

kernelmenu:reconnect-to-kernel

重新连接到内核

kernelmenu:restart

重启内核…

0, 0

kernelmenu:restart-and-clear

重启内核并清除…

kernelmenu:shutdown

关闭内核

kernelmenu:shutdownAll

关闭所有内核…

launcher:create

新启动器

Ctrl Shift L

logconsole:add-checkpoint

添加检查点

logconsole:clear

清除日志

logconsole:open

显示日志控制台

logconsole:set-level

将日志级别设置为 level

mainmenu:open-first

打开第一个菜单

markdownviewer:edit

显示Markdown编辑器

markdownviewer:open

Markdown 预览

mathjax:clipboard

MathJax 复制 LaTeX

mathjax:scale

Mathjax 比例重置

mermaid:copy-source

Mermaid 复制图表源代码

notebook:access-next-history-entry

访问下一个内核历史记录条目

Alt 向下箭头

notebook:access-previous-history-entry

访问上一个内核历史记录条目

Alt 上箭头

notebook:change-cell-to-code

更改为代码单元格类型

Y

notebook:change-cell-to-heading-1

更改为标题1

1

notebook:change-cell-to-heading-2

更改为标题2

2

notebook:change-cell-to-heading-3

更改为标题 3

3

notebook:change-cell-to-heading-4

更改为标题4

4

notebook:change-cell-to-heading-5

更改为标题5

5

notebook:change-cell-to-heading-6

更改为标题6

6

notebook:change-cell-to-markdown

更改为Markdown单元格类型

M

notebook:change-cell-to-raw

更改为原始单元格类型

R

notebook:change-kernel

更改内核…

notebook:clear-all-cell-outputs

清除所有单元格的输出

notebook:clear-cell-output

清除单元格输出

notebook:close-and-shutdown

关闭并关机笔记本…

notebook:collapse-all-headings

折叠所有标题

Ctrl Shift 左箭头

notebook:copy-cell

复制单元格

C

notebook:copy-to-clipboard

复制输出到剪贴板

notebook:create-console

笔记本的新控制台

notebook:create-new

笔记本

notebook:create-output-view

为单元格输出创建新视图

notebook:cut-cell

切割单元格

X

notebook:delete-cell

删除单元格

D, D

notebook:deselect-all

取消选择所有单元格

notebook:disable-output-scrolling

禁用输出的滚动

notebook:duplicate-below

复制下方单元格

notebook:enable-output-scrolling

启用输出滚动

notebook:enter-command-mode

进入命令模式

退出

notebook:enter-edit-mode

进入编辑模式

输入

notebook:expand-all-headings

展开所有标题

Ctrl Shift 向右箭头

notebook:export-to-format

保存并将笔记本导出为给定的format

notebook:extend-marked-cells-above

向上扩展选择

Shift 上箭头

notebook:extend-marked-cells-below

向下扩展选择

Shift 向下箭头

notebook:extend-marked-cells-bottom

将选择扩展到底部

Shift End

notebook:extend-marked-cells-top

将选择扩展到顶部

Shift Home

notebook:get-kernel

获取内核

notebook:hide-all-cell-code

折叠所有代码

notebook:hide-all-cell-outputs

折叠所有输出

notebook:hide-cell-code

折叠选定的代码

notebook:hide-cell-outputs

折叠选定的输出

notebook:insert-cell-above

在上方插入单元格

A

notebook:insert-cell-below

在下方插入单元格

B

notebook:insert-heading-above

在当前标题上方插入标题

Shift A

notebook:insert-heading-below

在当前标题下方插入标题

Shift B

notebook:interrupt-kernel

中断内核

notebook:merge-cell-above

合并上方单元格

Ctrl Backspace

notebook:merge-cell-below

合并下方单元格

Ctrl Shift M

notebook:merge-cells

合并选中的单元格

Shift M

notebook:move-cell-down

向下移动单元格

Ctrl Shift ArrowDown

notebook:move-cell-up

上移单元格

Ctrl Shift ArrowUp

notebook:move-cursor-down

选择下面的单元格

ArrowDown

notebook:move-cursor-heading-above-or-collapse

选择上方标题或折叠标题

ArrowLeft

notebook:move-cursor-heading-below-or-expand

选择下面的标题或展开标题

ArrowRight

notebook:move-cursor-up

选择上方的单元格

ArrowUp

notebook:paste-and-replace-cell

粘贴单元格并替换

notebook:paste-cell-above

粘贴上方的单元格

notebook:paste-cell-below

粘贴下面的单元格

V

notebook:reconnect-to-kernel

重新连接到内核

notebook:redo

重做

notebook:redo-cell-action

重做单元格操作

Shift Z

notebook:render-all-markdown

渲染所有Markdown单元格

notebook:replace-selection

替换笔记本单元格中的选择

notebook:restart-and-run-to-selected

重启内核并运行到选定的单元格…

notebook:restart-clear-output

重启内核并清除所有单元格的输出…

notebook:restart-kernel

重启内核…

notebook:restart-run-all

重启内核并运行所有单元格…

notebook:run-all-above

运行上方所有选中的单元格

notebook:run-all-below

运行选中的单元格及其下方的所有单元格

notebook:run-all-cells

运行所有单元格

notebook:run-cell

运行选定的单元格但不前进

Ctrl Enter

notebook:run-cell-and-insert-below

运行选定的单元格并在下方插入

Alt Enter

notebook:run-cell-and-select-next

运行选定的单元格

Shift Enter

notebook:run-in-console

在控制台中运行选定的文本或当前行

notebook:select-all

选择所有单元格

Ctrl A

notebook:select-last-run-cell

选择当前正在运行或最后运行的单元格

notebook:set-side-by-side-ratio

设置并排比例

notebook:show-all-cell-code

展开所有代码

notebook:show-all-cell-outputs

展开所有输出

notebook:show-cell-code

展开选定的代码

notebook:show-cell-outputs

展开选定的输出

notebook:shutdown-kernel

关闭内核

notebook:split-cell-at-cursor

拆分单元格

Ctrl Shift -

notebook:toggle-all-cell-line-numbers

显示行号

notebook:toggle-autoclosing-brackets

为所有笔记本单元格类型自动关闭括号

notebook:toggle-cell-outputs

切换选定输出的可见性

notebook:toggle-heading-collapse

切换折叠笔记本标题

notebook:toggle-render-side-by-side-current

并排渲染

Shift R

notebook:toggle-virtual-scrollbar

显示小地图

notebook:trust

信任笔记本

notebook:undo

撤销

notebook:undo-cell-action

撤销单元格操作

Z

pluginmanager:open

高级插件管理器

pluginmanager:refresh

刷新插件列表

property-inspector:show-panel

属性检查器

Ctrl Shift U

recentmenu:open-recent

打开最近的文件(由recent参数指定)

recentmenu:reopen-last

重新打开已关闭的文档

Ctrl Shift T

rendermime:handle-local-link

处理本地链接

runmenu:open

打开运行菜单

runmenu:restart-and-run-all

重启内核并运行全部

runmenu:run

运行选定的

Shift Enter

runmenu:run-all

全部运行

running:kernel-new-console

内核的新控制台

running:kernel-new-notebook

新笔记本用于内核

running:kernel-open-session

未知会话

running:kernel-shut-down

关闭内核

running:kernel-shut-down-unused

关闭未使用的

running:show-modal

搜索标签和运行会话

Ctrl Alt A

running:show-panel

会话和标签页

Ctrl Shift B

settingeditor:export

导出用户设置

settingeditor:open

设置编辑器

Ctrl ,

settingeditor:open-json

高级设置编辑器

settingeditor:revert

恢复用户设置

settingeditor:save

保存用户设置

Ctrl S

settingsmenu:open

打开设置菜单

shortcuts:add-keybinding

添加快捷键

shortcuts:delete-keybinding

删除键绑定

shortcuts:edit-keybinding

编辑键绑定

shortcuts:reset-all

重置所有

shortcuts:toggle-selectors

切换选择器

sidebar:switch

切换侧边栏位置

statusbar:toggle

显示状态栏

tabsmenu:activate-by-id

通过其id激活一个小部件。

tabsmenu:activate-previously-used-tab

激活之前使用的标签页

Ctrl Shift ‘

tabsmenu:open

打开标签菜单

terminal:copy

复制

terminal:create-new

终端

terminal:decrease-font

减小终端字体大小

terminal:increase-font

增大终端字体大小

terminal:open

通过其name打开一个终端。

terminal:paste

粘贴

terminal:refresh

刷新终端

terminal:set-theme

将终端主题设置为提供的 theme

terminal:shut-down

关闭终端

toc:display-h1-numbering

显示一级标题编号

toc:display-numbering

在文档中显示标题编号

toc:display-outputs-numbering

显示输出标题

toc:run-cells

选择并运行此标题的单元格

toc:show-panel

目录

Ctrl Shift K

toc:toggle-collapse

折叠所有标题

tooltip:dismiss

关闭工具提示

退出

tooltip:launch-console

打开工具提示

Shift Tab

tooltip:launch-file

打开工具提示

Shift Tab

tooltip:启动笔记本

打开工具提示

Shift Tab

tsv:go-to-line

转到行

viewmenu:line-numbering

显示行号

Shift L

viewmenu:match-brackets

匹配括号

viewmenu:open

打开视图菜单

viewmenu:word-wrap

换行

workspace-ui:clone

克隆工作区…

workspace-ui:create-new

创建新工作区…

workspace-ui:delete

删除工作区…

workspace-ui:export

导出工作区…

workspace-ui:import

导入工作区…

workspace-ui:open

打开工作区…

workspace-ui:rename

重命名工作区…

workspace-ui:reset

重置工作区…

workspace-ui:save

保存当前工作区

workspace-ui:save-as

将当前工作区另存为…