'Enable showing Line Number in jupyter lab by default

We can enable/disable showing LineNumbers in each code block from "View" tab in Jupyter Lab. But this has to be done every time I open new instance of Jupyter-lab. It doesn't keep showing lineNumber enabled ON by default.

How do I keep showing lineNumber enabled by default ?



Solution 1:[1]

Go to "Settings" tab-->"Advanced Settings Editor"-->"Notebook"

Paste the following under "User Preferences" section and SAVE:

{ "codeCellConfig": {
        "autoClosingBrackets": true,
        "fontFamily": null,
        "fontSize": null,
        "lineHeight": null,
        "lineNumbers": true,
        "lineWrap": "off",
        "matchBrackets": true,
        "readOnly": false,
        "insertSpaces": true,
        "tabSize": 4,
        "wordWrapColumn": 80,
        "rulers": [],
        "codeFolding": false,
        "lineWiseCopyCut": true
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vivek Dani