0

I have recently switched to Visual Code for Python coding and attempted to change keybindings. However, I came cross two seemingly different but yet similar keybindings:

"Jupyter: Run Current Cell And Advance" and "Notebook: Execute Notebook Cell and Select Below" (See image below).

Since they appear to do the same thing I gave them the same keyboard shortcut but I am still confused between the difference of the two.

From my understanding keyboard shortcuts are context sensitive. For instance, you will have different shortcuts when opening a .ipynb file when compared to opening a .py file.

So when is the "Jupyter"-context used as opposed to the "Notebook"-context? Are they not the same?

"Jupyter: Run Current Cell And Advance" and "Notebook: Execute Notebook Cell and Select Below" keybindings.

Peter Macej
  • 4,831
  • 22
  • 49
Dureade
  • 3
  • 1

1 Answers1

0

Any Shortcuts works under some conditions specified in the When. So, although you can find a lot of identical Shortcuts, they will not conflict with each other on usual.

The Notebook related shortcut was build in the VSCode, while the Jupyter related shortcut was created by Jupyter Extension.

But you can find many Notebook shortcut can be used in the Jupyter. That's because Notebook was the common API in the VSCode, it intends to bring similar experiences inside VSCode in different Notebook interfaces.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13
  • Thank you for answering Steve! Just to check my understanding, when I open a .ipynb file from with VSCode (under the assumption I have the Jupyter extension installed), is this opened .ipynb file handled by the VSCode native Notebook API or the Jupyter extension? – Dureade Jun 29 '21 at 13:33
  • @Dureade Glad to hear from you. Jupyter Extension. '.ipynb' file is just a JSON file, it only contains some JSON Infos. Without the proper extension to handle it, it will only display like a JSON file. And the Notebook API that build-in the VSCode can not handle the notebook in fact. It only provide the similar experiences between different notebook. Such as 'Jupyter Notebook' and 'Google Colab'. But it can't hanle the pragmatic notebook by itself. – Steven-MSFT Jun 29 '21 at 14:26
  • Great, thanks again @Steven! So it seems that the native Notebook API facilitates a streamlined experience between different types of Notebooks (e.g., through keyboard shortcuts that could be used for 'Google Colab' and/or 'Jupyter Notebook'), but actually opening a .ipynb file and displaying it in VSCode, is handled by the Jupyter extension. Since I understand now, I will mark the question as answered. – Dureade Jun 29 '21 at 15:38