Reputation: 683
I'm working with a Jupyter notebook. How would you copy cells in Visual Studio Code? C to copy and V to Paste did not work for me as it would online.
Also, Visual Studio doesn't seem to offer right click options when working in the notebook. Is there a extension that would give me some options such as Cut, Copy, Paste, Delete Cell, Etc.?
Upvotes: 10
Views: 19792
Reputation: 1021
Ctrl
+ A
to selelct the whole text in the cellCtrl
+ C
to Copy the code.Ctrl
+ V
to paste your code anywhere.Upvotes: 0
Reputation: 161
As of 2021-01-14, you can now select the cells, right click on any single one of the cells you selected (this will select them as a group if you select more than one) and have the option to press COPY. Or you can simply ctrl+C as a keyboard shortcut. The key here is when you copy and paste the cells to another notebook, your cursor needs to be outside any cells; that is you need to press somewhere outside the cell before pasting. In COLAB notebook, even if your cursor is on a cell, the copy and pasting method works. BUT here if you do that you will be pasting all of the codes inside the cell where your cursor is active; it will not paste the actual cells you copied.
Hope this wasn't too confusing.
Upvotes: 0
Reputation: 789
The new version of the visual studio Jupyter Notebook extension support all the standard operations for one or multiple cells of the jupyter notebook. For example, the following list shows some tested shutcuts:
copy
a selected cell(s) use: ctrl+c
paste
a selected cell(s) use: ctrl+v
cut
a selected cell(s) use: ctrl+x
delete
a selected cell(s) use: ctrl+x
Note that, as usual, to select multiples cells one should hold the ctrl
button before selecting.
Upvotes: 0
Reputation: 3097
I'm a developer on this extension, and I have a bit of a two part answer for you.
This support will not be added to the old editors, but currently the new UI is available if you use the extension with VS Code - Insiders and will soon start rolling out to VS Code Stable.
https://devblogs.microsoft.com/python/notebooks-are-getting-revamped/
Short answer: Supported with VS Code - Insiders now, and will be supported on stable VS Code in the future.
Upvotes: 5