Go to the previous cell with a keyboard shortcut - visual-studio-code

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?

Related

Keyboard shortcut to move cursor to next cell in VS Code

Is it possible to move the cursor from one script cell to another using a keyboard shortcut using Visual Studio Code i.e. navigating between cells during editing?
I only found the possibility to run single cells but not the possibility of moving only the cursor to the next or to the previous script cell designated by #%%.

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.

How to add a command to Jupyter Notebook toolbar in 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.

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.