问题描述
在普通的Jupyter笔记本中,我们可以通过选择单元格后按 L 键来添加行号.该笔记本的所有后续单元格将自动具有行号.
In the normal Jupyter notebooks, we can add line numbers by pressing the L key after selecting the cell. All the subsequent cells for that notebook will have line numbers automatically.
但是VSCode中缺少此功能.每次创建新单元格时,我们都需要选择该单元格并按 L 键以启用该单元格的编号,这非常麻烦.
But this is missing in VSCode. Every time a new cell is created, we need to select the cell and press the L key to enable the numbering for that cell which is very tiresome.
是否可以为VSCode Jupyter笔记本中的所有单元格自动启用行编号,而不是为每个单元格手动按 L 键?
Is there a way to automatically enable line numbering for all the cells in the VSCode Jupyter notebook instead of manually pressing the L key for each and every cell?
谢谢.
推荐答案
在VS Code Jupyter Notebook中,您可以通过按 L 来切换行号.诀窍是首先选择当前单元格.您可以通过单击单元格左空白处的空白区域来选择单元格(选中该单元格后,左侧的栏会变为蓝色).现在,如果您按键盘上的 L ,则可以打开/关闭行号.
In VS Code Jupyter Notebook, you can toggle line numbers by pressing L. The trick is to select the current cell first.You could select your cell by clicking in the blank area on the left margin of the cell (when it's selected the bar on the left turns blue). Now if you press L on your keyboard, you would be able to turn the line numbers on/off.
这篇关于VSCode Jupyter Notebook单元中每个单元的行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!