Bee*_*len 21 python editor jupyter visual-studio-code
我正在使用 Jupyter Notebook 扩展在 VS Code 中编辑 .ipynb 文件。我似乎不知道如何折叠(或展开)单元格。
有人可以向我解释如何做到这一点(使用热键或不使用热键),或者给出我可能做错的想法吗?
我在三组条件下尝试了下面显示的每个热键:1. 选中单元格输入左侧的蓝色竖条,2. 单元格左侧的蓝色竖条输出选择,3.将光标放在单元格输入中。
Mar*_*ark 50
v1.64 中出现了另一种折叠单元格的方法。看
单元格折叠 UI
笔记本单元格左侧有一个蓝色条,表示它们已聚焦。该栏现在是交互式的 - 您可以单击顶部部分来折叠单元格输入,单击底部部分来折叠输出。
小智 6
在我的 VSCode 内部人员构建版本 1.61.0 中,它可以工作。
正在做什么 ->
a) One shot expand/collapse all cells(code/output) in '.ipynb'(notebook)
b) Single cell code/output expand/collapse in '.ipynb'(notebook)
c) code folding in `.py` file with `#%%` (hierarchy style)
Run Code Online (Sandbox Code Playgroud)
为了.ipynb
(您的要求)
有可用的键绑定:jupyter.notebookeditor.expandallcells/collapseallcells
它能做什么?
Expands/collapses all cells in one shot
Run Code Online (Sandbox Code Playgroud)
找到这个设置->
Top menu File->Preferences->Keyboard Shortcuts
In search("Type to search in keybindings"...top side)
type "Notebook Expand" or "Notebook Collapse", check out:
Notebook: Expand/Collapse All Cells,
Notebook: Expand/Collapse Cell Input and
Notebook: Expand/Collapse Cell Output
Its possible to expand/collapse single/all cells with these shortcuts keys.
Run Code Online (Sandbox Code Playgroud)
为了使这个答案完整(其他人已经回答)->
1. double click gutter area (immediate space on left side of code cell) to Expand/Collapse cell (code/output)
2. right click on gutter area to get Expand/Collapse cell (code/output)
Run Code Online (Sandbox Code Playgroud)
我正在使用版本 1.58.2,此功能现已可用!
\n只需右键单击代码单元格并选择“折叠单元格输出”。
\n或者,单击代码单元格(确保您处于命令模式)并使用键盘快捷键 \xe2\x8c\x98K T(在 Mac 上)或 Ctrl-K T (在 Windows 上)。
\n\n对我有用的确切方法是:
转到文件 -> 首选项 -> 键盘快捷键
搜索“折叠所有单元格输入”
双击或单击此选项前面的加号,然后选择一个唯一的快捷键组合(例如 Ctrl + Shift + C Ctrl + Shift + A)
您已准备就绪,现在您终于可以一次折叠所有输入单元格了。
目前,VS Code 的 Jupyter 中不支持使用此功能,您可以参考此链接:Jupyter Notebook 单元格代码折叠和输出视图扩展请求。
另外,请尝试使用“ Visual Studio Code Insiders ”,右键单击 Jupyter 的单元格,然后选择“ Collapse Cell Input
”或“ Collapse Cell Output
”:
前:
后:
归档时间: |
|
查看次数: |
21037 次 |
最近记录: |