1

I am using Jupyterlab, 1.2.4. I tried the configuration below, but it gives an error. Any idea why?

Jupyter lab shortcuts

[additional property error] notebook:collapse-selected-outputs is not a valid property

enter image description here

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

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

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

  "notebook:collapse-all-code": {
    "command": "notebook:hide-all-cell-code",
    "keys": [
      "Shift O"
    ],
    "selector": ".jp-Notebook:focus"
  }
}
DV82XL
  • 5,350
  • 5
  • 30
  • 59
Chris
  • 951
  • 10
  • 26

1 Answers1

1

I just copied the same JSON format that's used in the System Defaults section and everything works. Copy this to the User Preferences section.

{
  "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"
    }
  ]
}

Tested on JupyterLab 1.2.6.

DV82XL
  • 5,350
  • 5
  • 30
  • 59