Saran
Saran

Reputation: 1844

Show code line numbers in JupyterLab

In Jupyter notebook, cntrl+ m L toggles code line numbers in current cell but how to bring the code line numbers in JupyterLab?

Referred a similar issue opened in github

Upvotes: 46

Views: 59417

Answers (7)

itaallllllive
itaallllllive

Reputation: 1

Fix for JupyterLab 4.3.4. Edit the file:

$HOME/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings

and change

    "codeCellConfig": { 
        "lineNumbers": false, 
    },

to true. Then restart JupyterLab.

Upvotes: 0

Eric Kreipe
Eric Kreipe

Reputation: 71

I'm new at this so don't flame me. But Frank said from View -> Show Line Numbers. I did this from main JupyterLab window. I'm using version 3.5.0.

Upvotes: 1

Jiaxiang
Jiaxiang

Reputation: 883

In your Jupyter Lab, click the chain, View -> Line numbers. This solution is from this GitHub issue.

Upvotes: 2

cyneo
cyneo

Reputation: 946

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

Upvotes: 59

Neeraj Khadagade
Neeraj Khadagade

Reputation: 76

Late reply, but it'll still help others!

For Windows users, just hit Shift + L

Upvotes: 3

ohailolcat
ohailolcat

Reputation: 998

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

Upvotes: 62

Franck Dernoncourt
Franck Dernoncourt

Reputation: 83197

You can go to View -> Show Line Numbers:

enter image description here

which will display line numbers in the notebook:

enter image description here

Upvotes: 40

Related Questions