Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 688
Saranraj Nambusubramaniyan Avatar asked Mar 28 '18 13:03

Saranraj Nambusubramaniyan


People also ask

How do you show line numbers in Jupyter Notebook Vscode?

In VS Code Jupyter Notebook, you can toggle line numbers by pressing L.

How do I change line numbers in Jupyter Notebook?

The easiest way to add line numbers to a Jupyter Notebook is to use the keyboard shortcut, which is Ctrl-m to enter Command Mode, then type L. Just highlight the cell you are interested in adding line numbers to, then hit the keyboard shortcut to toggle the line numbers.

How do I remove line numbers in Jupyter Notebook?

Esc and 'l' will remove the numbering from current cell. Esc and 'L' will remove the numbering from all the cells of notebook.

Does JupyterLab have code completion?

To enable code autocomplete in Jupyter Notebook or JupyterLab, you just need to hit the Tab key while writing code. Jupyter will suggest a few completion options. Navigate to the one you want with the arrow keys, and hit Enter to choose the suggestion.


2 Answers

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

like image 89
ohailolcat Avatar answered Sep 20 '22 08:09

ohailolcat


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     } } 
like image 42
cyneo Avatar answered Sep 22 '22 08:09

cyneo