简体   繁体   English

jupyter 的 Visual Studio Code 快捷方式

[英]Visual Studio Code shortcuts for jupyter

I'm trying to make keybindings for some jupyter commands in VSC with the Python extension.我正在尝试使用 Python 扩展名为 VSC 中的一些 jupyter 命令进行键绑定。 Say, I want to bind runallcellsabove command to ctrl+alt+cmd+d .说,我想将runallcellsabove命令绑定到ctrl+alt+cmd+d Added the folowing code to keybindings.json (just copied from the sibling runcurrentcell command and changed "key" and "command" fields):将以下代码添加到 keybindings.json (刚刚从兄弟runcurrentcell命令复制并更改了“key”和“command”字段):

    {
        "key": "ctrl+alt+cmd+d",
        "command": "python.datascience.runallcellsabove.palette",
        "when": "editorTextFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection"
    }

Now, I can see this shortcut in Keyboard Shortcuts :现在,我可以在Keyboard Shortcuts键中看到这个快捷键: 在此处输入图像描述

But nothing seems to work.但似乎没有任何效果。 Am I doing something wrong?难道我做错了什么?

Things have changed since this was asked, but as of 2021:自从提出这个问题以来,情况发生了变化,但截至 2021 年:

Sorry but most of the custom editor settings do not apply yet to the Jupyter notebook editors.抱歉,大多数自定义编辑器设置尚不适用于 Jupyter 笔记本编辑器。

They aren't being hosted inside of VS code, but inside of a separate process that uses an editor that looks a lot like VS code's.它们不是托管在 VS 代码内部,而是托管在一个单独的进程内部,该进程使用一个看起来很像 VS 代码的编辑器。 We need to port all of the functionality for VS code over to this new editor before it will work there as well.我们需要将 VS 代码的所有功能移植到这个新的编辑器中,然后它才能在那里工作。

https://github.com/microsoft/vscode-jupyter/issues/1447#issuecomment-542282705 https://github.com/microsoft/vscode-jupyter/issues/1447#issuecomment-542282705

I believe these are embedded code-mirror editors - there are code-mirror config suggestions in here https://github.com/microsoft/vscode-jupyter/issues/1447 which you might adapt to implement your own keybindings.我相信这些是嵌入式代码镜像编辑器 - 这里有代码镜像配置建议https://github.com/microsoft/vscode-jupyter/issues/1447 ,您可能会适应这些建议来实现自己的键绑定。

Meanwhile - seems native keys will arrive soon?同时-似乎本机密钥即将到来?

Native Notebooks - Essential Jupyter Shortcuts to be supported · Issue #4376 · microsoft/vscode-jupyter原生笔记本 - 要支持的基本 Jupyter 快捷方式 · 问题 #4376 · microsoft/vscode-jupyter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM