Jupyter lab shortcuts

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

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.

Leave a Comment