Added a command to replace the selection in an editor with text
(inserting if there is no selection). This can be assigned a
keyboard shortcut, as shown below. We also added a command to go
through a series of commands and run the first enabled command.
(#7908) Here
is a keyboard shortcut to insert text in a currently-active notebook
editor:
{
command: "notebook:replace-selection",
selector: ".jp-Notebook",
keys: ["Ctrl L"],
args: {text: "lambda x: x"}
}
Here is a keyboard shortcut to insert text into an editor of the
currently active console, file editor, or notebook:
{
command: "apputils:run-first-enabled",
selector: "body",
keys: ["Ctrl L"],
args: {
commands: [
"console:replace-selection",
"fileeditor:replace-selection",
"notebook:replace-selection",
],
args: {text: "lambda x: x"}
}
}