In vscode notebooks, you can add markdown headers to divide your notebook into sections which can be collapsed / folded. Is there a way to execute all cells within such collapsed section, without unfolding it and running all the cells manually one by one?
There is a feature request in the vscode repo describing precisely this and it's marked as completed, so the functionality should be there. However, using the usual Shift+Enter or Ctrl+Enter on a markdown header does not run anything in vscode 1.68.1. I also cannot see it mentioned in the docs anywhere and the issue is locked, so one cannot ask there.
Related
Is it possible to change the appearance of Jupyter Notebooks on VSCode, for them to look more like the browser version ?
In particular, I find the inter-cells space (1) way too big, and the check mark that indicates the execution (2) to also taking too much place.
I think that at the end in a page I cannot see enough code.
Is it possible to modify that ?
screenshot of the popup code suggestion box being mentioned
In VSCode Jupyter Notebook code cells, I keep having this annoying popup when I open any single or double quotes. It doesn't appear on markdown cells, nor in regular editor on .py files. It doesn't look like your typical IntelliSense suggestions either (I think), and I've tried to disable as many of such extensions as possible, but I'm not able to get rid of this annoying popup.
Appreciate if someone could point me in the right direction. Or at least what it's actually called, so I can Google the correct term. Thanks.
Figured it out.
In VS Code settings, go to Extensions > Jupyter > Python Completion Trigger Characters
defaults were: .%'"
So I deleted the single and double quotes, restarted, and voila, no more annoying popups.
Below is a screenshot of what I mean. I'd like it to show only the headers of the notebook, not each and every single markdown block. Is there a similar way to changing this, like in JupyterLab, where you can toggle different outline options?
I use markdown headers to navigate in notebooks but I also tend to make a lot of (non-header) markdown notes. Both show up in the outline which makes finding the right heading quite difficult as notebooks grow large.
Is there a way to suppress plain markdown cells showing up in the outline?
I have followed the discussion on github and at Creating Table of Contents in VS code Jupyter Notebook
the author of one answer was also not satisfied with the outline feature and created jupyter TOC extension, and at some point, I also ended up using it. This has an option to exclude text from visualization (I believe it is possible to set maximum expansion level), but I still consider the outline more desireable, because it stays visible when I scroll the document, which I consider essential.
The workaround I found is to put, when possible, text in the same cell as the header. This makes it easier to keep the outline clean, and just avoiding to expand too much the outline works decently for me, even if it implies some annoying restrictions on the way you structure text. Other than that, it is possible to play with the collapse/expand feature of the outline and get a sufficient control, even if the possibility of completely exclude the text is still a desireable upgrade.
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.?
I'm a developer on this extension, and I have a bit of a two part answer for you.
In the current (as of 2/16/21) stable release version of the extension notebook UI is done by a hosted webview, it was the only supported option at the time. As such it is lacking features both of Jupyter and of VS Code editor instances. It does not currently support cutting, copying and pasting of cells.
We are currently in the process of moving over to VS Code's new notebook UI that they provide. This allows better UI both for matching Jupyter and supporting more VS Code editor features. This current UI does allow for copying / cutting / pasting cells with the familiar Jupyter commands.
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.
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:
To copy a selected cell(s) use: ctrl+c
To paste a selected cell(s) use: ctrl+v
To cut a selected cell(s) use: ctrl+x
To delete a selected cell(s) use: ctrl+x
etc.
Note that, as usual, to select multiples cells one should hold the ctrl button before selecting.
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.