Jupyter实验室快捷键 [英] Jupyter lab shortcuts

查看:135
本文介绍了Jupyter实验室快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Jupyter笔记本电脑已有两年了.我刚刚去了Jupyter Lab,但是我发现缺少捷径是一种负担.

I've been using Jupyter Notebooks for a couple of years now. I've just headed over to Jupyter Lab, but I've found the lack of shortcuts to be a burden.

例如,我注意到我可以在左侧面板中搜索命令. 但是我似乎无法轻松地将它们绑定到键盘快捷键.甚至有可能吗?

For example, I noticed that I can search for commands in the left hand palette. But I can't seem to easily bind them to a keyboard shortcut. Is this even possible?

例如,我想用"O"折叠当前单元格输出,并用"Shift O"折叠所有代码单元.

For example, I want to collapse the current cell output with "O" and collapse all code cells with "Shift O".

推荐答案

此问题已在GitHub 这里.您也可以在此处,以便在键盘快捷键用户中输入正确的command名称,因为它们并不总是与Commands侧栏中显示的名称相同.

This question is answered on GitHub here. You can also look here for the correct command names to enter in your keyboard shortcut user overrides because they are not always the same as what is shown in the Commands side-bar.

以下是我使用的一些内容:

The following are some that I use:

{
  "shortcuts": [
    {
      "command": "notebook:hide-cell-outputs",
      "keys": [
        "O"
      ],
      "selector": ".jp-Notebook:focus"
    },    
    {
      "command": "notebook:show-cell-outputs",
      "keys": [
        "O", 
        "O"
      ],
      "selector": ".jp-Notebook:focus"
    },    

    {
      "command": "notebook:hide-all-cell-outputs",
      "keys": [
        "Ctrl L"
      ],
      "selector": ".jp-Notebook:focus"
    },

    {
      "command": "notebook:hide-all-cell-code",
      "keys": [
        "Shift O"
      ],
      "selector": ".jp-Notebook:focus"
    }
  ]
}

允许您通过按一次O隐藏单元格输出,并通过按两次O来显示单元格输出.最后一个根据您的要求使用Shift + O折叠所有单元格代码.

which allows you to hide a cell output by pressing O once and showing the cell output by pressing O twice. The last one collapses all cell code with Shift + O as you requested.

这篇关于Jupyter实验室快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆