Feature Request: proposal for additional keyboard shortcuts
I have been using the following keyboard shortcuts for a while. I post them here for evaluation, I find them very convenient and I think they fit very well with the existing default shortcuts (e.g. "Alt W" for "application:close"). If agreed I can submit a PR.
{
"shortcuts": [
{
"command": "runmenu:run-all",
"keys": [
"Alt R"
],
"selector": "[data-jp-code-runner]"
},
{
"command": "runmenu:restart-and-run-all",
"keys": [
"Ctrl Alt R"
],
"selector": "[data-jp-code-runner]"
},
{
"command": "jupyterlab_code_formatter:format",
"keys": [
"Alt F"
],
"selector": ".jp-Notebook.jp-mod-editMode"
},
{
"command": "jupyterlab_code_formatter:format_all",
"keys": [
"Ctrl Alt F"
],
"selector": ".jp-Notebook.jp-mod-editMode"
},
{
"command": "application:activate-next-tab",
"keys": [
"Alt 2"
],
"selector": "body"
},
{
"command": "application:activate-previous-tab",
"keys": [
"Alt 1"
],
"selector": "body"
},
{
"command": "tabsmenu:activate-previously-used-tab",
"keys": [
"Alt 0"
],
"selector": "body"
},
{
"command": "filemenu:close-and-cleanup",
"keys": [
"Alt Q"
],
"selector": ".jp-Activity"
}
]
}
Hmm I feel like this is just down to personal reference, but I do think more documentation regarding the possible shortcut for format and format_all might help.
Oh unless you mean include this as the default set of keybindings instead of just documentation?
Yes, if you agree I can create a PR to add this to the default set.
Do you happen to know how user can remove the default set of keybindings? If there is no such option, I would prefer us not to provide a keybinding that leads with "Alt", they usually allow users to open the browser context menu.
You can redefine the keybindings that you do not want. The default set already defines "Alt W" for "application:close". And you can still open the browser context menu with "Alt" alone. I took care not to overwrite common browser keystrokes, such as "Ctrl R", "Ctrl F", etc. As far as I know, "Alt 1" and "Alt 2" are used only by Firefox under Linux (instead of "Ctrl 1" and "Ctrl 2") to switch to tabs 1 and 2, but if you are working within Jupyter Lab it makes sense that they act on its tabs.
Another option could be "Alt N" for "application:activate-next-tab", "Alt P" for "application:activate-previous-tab", and "Alt L" for "tabsmenu:activate-previously-used-tab" (last used tab).
Another option could be "Alt PageDown" for "application:activate-next-tab", "Alt PageUp" for "application:activate-previous-tab", and "Alt L" for "tabsmenu:activate-previously-used-tab" (last used tab). But "PageDown" / "PageUp" don't work.
Sorry I now realized that I opened this issue on the wrong repository, I am going to report this to JupyterLab, apart from "Alt F" and "Ctrl Alt F" that would remain here.
...I did already in the past and forgot about it, see PR #7558. So for your evaluation is only "Alt F" and "Ctrl Alt F", maybe you want to wait the decision about PR #7558.
Closing due to inactivity, just having a look again, I think these are the responbility of the end-user anyway :sweat_smile: