Jupyter lab shortcuts

后端 未结 6 1772
-上瘾入骨i
-上瘾入骨i 2020-12-12 21:56

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 exampl

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 22:02

    pX0r and plalanne's answers above combined worked for me with minor modification for Mac.

    I hope this step-by-step iteration is helpful for someone like me who's a baby programmer. To summarize:

    1. Open Advanced Settings Editor under the Settings tab, or command , in Mac.
    2. Navigate to Keyboard Shortcuts. You should see the screen plalanne answered with.
    3. Use pX0r's codes, however making one change in the key binding as Ctrl Arrowup is reserved in Mac to view all running applications (if you have it set up that way). Similarly, Shift Arrowup is for selecting multiple cells. As a result, I opted for Alt Arrowup. Notice the key on your Mac keyboard says alt/option. You have to refer to it as Alt to work. There you have it. Copy the codes below to User Overrides which is the right pane.
    4. Re-open your notebook and test if it works as intended.
    5. You can customize more keys in this fashion as long as it is defined here on GitHub. For the most part, all that you need are the command IDs starting line 72.
    {
        // Move cell up
        "notebook:move-cell-up": {
          "selector": ".jp-Notebook:focus",
          "command": "notebook:move-cell-up",
          "keys": [
            "Alt ArrowUp"
          ]
        },
    
        // Move cell down
        "notebook:move-cell-down": {
          "selector": ".jp-Notebook:focus",
          "command": "notebook:move-cell-down",
          "keys": [
            "Alt ArrowDown"
          ]
        }
    }
    

提交回复
热议问题