How to add a command to Jupyter Notebook toolbar in Visual Studio Code? - visual-studio-code

My default Jupyter Notebook toolbar in VS Code has a command "Clear Outputs of All Cells". I would like to add a similar but different command Notebook: Clear Cell Outputs, which only clears one cell at a time. I can do that by pressing ALT + DEL, but it would be convenient to have it in toolbar.

I have added this button to the Context Menu Extra extension (v0.4.0) (You need VSC v1.62, because I don't know when some experimental API got public)
If the cell has output you should see the "Clear Cell Output" button in the cell toolbar at first position.
There is no documentation of the allowed groups for this menu. I have used a group the Jupyter extensions also uses. That is the reason it is one of the first buttons.

Related

Go to the previous cell with a keyboard shortcut

Let's suppose I am editing a code in a particular cell of a jupyter notebook in VSCode. Then I search for something and it takes me to another cell somewhere on the notebook. How can I navigate back to the original cell without tediously searching for it with a slider? Any appropriate keys to do that?

Is it possible to put a jupyter notebook cell in VSCode in interactive mode so that it runs the cell when its contents change

I'm looking for a way to put a jupyter notebook cell in VSCode in interactive mode so that it runs the cell when its contents change without having to run it explicitly.
If there's no existing solution, is it somehow possible to automate executing the cell periodically or does the VSCode jupyter lab integration offer some scripting hooks?
Alternatively, is there a possibility to explicitly execute a cell without loosing the cell focus and its current cursor position? CTRL+Enter directly doesn't work; the tabulator key needs to be pressed four times additionally to get back to the cell.

Is there a shortcut to switch between code panels in Spyder 5.2.1?

I'm currently new to Spyder and I'm trying to get a feel for the shortcuts.
I have seen that you can actually create multiple code panes using split vertical/horizontal (in order to work on multiple code files), however I didn't find any shortcut to switch between the multiple code panels I had.
So, is there any shortcut to move my text cursor from A panel to B panel ?
(Spyder maintainer here) There's no keyboard shortcut for that, sorry.

Move the cell in jupyter notebook up and down

I have a cell (cell 39), I wish to move up to the top of cell 40.
I know I could grab and drag to the place. However, I see that in official document, you could move it with the vertical bar on the left. However, I does not have one, and could not find the setting to make it display.
Demonstration in Visual Code.
Jupyter Notebook in chrome version has a similar botton for this function
Jupyter Notebook web version.
According to https://github.com/microsoft/vscode-jupyter/issues/6812 you can use alt(option)+arrow up/down to move the selected cell.
Or, use Command Palette with Notebook: Move

Collapse cell via code, or key shortcut in jupyterlab

Is it possible to collapse the cell itself - and not the output, either via a hotkey combo, or a line of code?
I know that by clicking on the blue line on the side it collapses it, but would want to streamline this.