Issue
When using JupyterLab, the indent setting seems to be ignored on notebook files (.ipynb). Tested with jupyterlab 3.1.1 (installed from pypi).
My user settings of the JupyterLab editor contains the following setting:
{
"editorConfig": {
"cursorBlinkRate": 530,
"fontFamily": null,
"fontSize": null,
"lineHeight": null,
"lineNumbers": true,
"lineWrap": "on",
"wordWrapColumn": 80,
"readOnly": false,
"tabSize": 4,
"insertSpaces": false,
"matchBrackets": true,
"autoClosingBrackets": false,
"rulers": [],
"codeFolding": false
}
}
I would expect, that the editor inserts a tab character when indenting with the tab-key, but it still inserts 4 spaces.
Jupyther notebook is able to insert tabs. I have the following settings in ~/.jupyter/nbconfig/notebook.json
:
{
"CodeCell": {
"cm_config": {
"indentWithTabs": true
}
}
}
With this setting, the normal notebook-editor is inserting tabs instead of spaces.
Is it possible, to have JupyterLab using tabs for indent characters on notebooks as well?
Solution
This editor setting is not affecting notebooks (at least not yet).
To get indentation with tabs (or other number of spaces than 4) in notebooks, you need to go to "Settings"->"Advanced Settings Editor". In the left pane select "Notebook" and insert the following in the user settings pane:
{
"codeCellConfig": {
"insertSpaces": false
},
"markdownCellConfig": {
"insertSpaces": false,
},
"rawCellConfig": {
"insertSpaces": false,
}
}
See https://github.com/jupyterlab/jupyterlab/issues/10751#issuecomment-890181712
Answered By - leviathan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.