Search code examples
jupyter-notebookjupyterjupyter-lab

Enable word wrap in JupyterLab code editor


I would like to enable word wrap for the code cells in jupyterlab, but do not manage to find how.

Already tried:

  • File --> Settings --> Text Editor --> User Overrides:{"lineWrap": true}, which toggles the greyed-out "word wrap" in the "Editor" menu, but does not solve my problem
  • This code also did not work (neither did simply "Cell": {...} ):
"CodeCell": {
    "cm_config": {
      "lineWrapping": true
    }
  }

Solution

  • Try the following,

    {
       "codeCellConfig": {
          "lineWrap": "wordWrapColumn",
          "wordWrapColumn": 80
       }
    }
    

    For reference, see this pull request from the JupyterLap project on GitHub.