首页 > 解决方案 > VScode定义自定义快捷方式重新启动并运行所有

问题描述

我最近一直在为我的笔记本使用 VS Code。但是,我真的很怀念香草 Jupyter 笔记本中提供的“重新启动并运行所有”快捷方式。我在设置中找到了重启选项。
在此处输入图像描述 我还找到了 run-all 选项。 在此处输入图像描述 有没有办法可以将这两个触发器合并为一个?

标签: visual-studio-codejupyter-notebookjupyter

解决方案


有一个叫做 vscode 的扩展程序multi-command可以让你做到这一点。转到您的扩展程序,找到扩展程序并安装它。完成此操作后,转到您的键绑定并打开keybindings.json,您可以通过单击此处进行操作(附图片)。

这里

然后继续添加以下内容:

{
  "key": "oem_8",                            //put whatever key you want here
  "command": "extension.multiCommand.execute",
  "args": {
    "sequence": [                            //put whatever keybind actions you want in here
      "jupyter.notebookeditor.restartkernel",
      "notebook.execute"
    ]
  },
  "when": "editorTextFocus"
}

我希望我有所帮助!


推荐阅读