Show code line numbers in JupyterLab

You can go to View -> Show Line Numbers:

enter image description here

which will display line numbers in the notebook:

enter image description here


you can turn this on by default by going into Settings --> Advanced Settings Editor:

enter image description here

As you can see from the screenshot, you can edit other features as well and easily set them back to default by deleting your 'User Overrides'

Go to Settings > Advanced configuration and add:

{
    "codeCellConfig": {
        "lineNumbers": true
    }
}

Late reply, but it'll still help others!

For Windows users, just hit Shift + L


https://github.com/jupyterlab/jupyterlab/issues/2395 - Shift+L toggles line number visibility.