Closed rezaeir closed 3 years ago
There is no shortcut for this, but a technical problem is that SoS notebooks can have different sets of subkernels, how do you define shortcuts to handle them? Perhaps you can do something like Ctrl-Shift-S 1
, Ctrl-Shift-S 2
for the first and second subkernel?
Or it could be Ctrl+Shift+S for cycling through the list.
At least in my environment I have a long list of subkernels and few of them will be used in each notebook.
Cycling through currently used subkernels makes more sense but the first subkernel has to be selected by mouse.
I think it is better to set the Ctrl+Shift+S the default to cycle between all subkernels and start from SoS itself. Moreover set Ctrl+Shift+S + (another letter or name) which is configurable by the user with some default ones for P: python, R: r, J:julia, or etc. which can be mentioned in the docs. Like, I don't know, setting a magic command that can be used with a dictionary to set these letters and then they combine with the base Ctrl+Shift+S to make the final shortcuts.
That is certainly possible and we could even allow language modules to define shortcuts. However we will have to pre-define many shortcuts, which is not a good idea at least according to Jupyter developers.
I do think this is a good idea especially if we can incorporate switching to "normal markdown" cell because it is currently a bit troublesome to switch between markdown and code cells. The JLab guys plan to do something about it though (e.g. an icon to insert markdown).
ok, in the last-released jupyterlab-sos 0.6.8 and sos-notebook 0.21.14 I adopted @ktaletsk 's suggestion to use Ctrl-Shift-S
to toggle between used kernels. This avoids cycling through all the unused kernels in the document, but has the side effect of doing nothing if SoS
is the only kernel used in the notebook.
Let us keep this feature as experimental, improve it until everyone is happy.
In jupyterlab and jupyter notebook, there are shortcuts to change cell type between code and markdown. I wonder if you could similar shortcuts to change subkernels, instead of using the mouse to change them or the %use magic command. Or if there are already such shortcuts and I couldn't find it, I appreciate it if you could let me know their corresponding keys!