22

I would like to add a ruler at 80 characters. I know that you can add rulers to CodeMirror, but I don't know if I'm supposed to place the corresponding javascript in a file somewhere, or in JupyterLab's Advanced Settings Editor > CodeMirror > User Overides section, or if I should do something else all together to get it working.

I'm using JupyterLab 0.31.8

jpobst
  • 3,491
  • 2
  • 25
  • 24

1 Answers1

35

The feature is available in the recently shipped JupyterLab 1.0.

The feature now is implemented in the current JupyterLab 1.0 alpha (see this PR).

Enable rulers in JupyterLab 1.0

Note: in addition to adding

{
    "codeCellConfig": {
        "rulers": [80]
    }
}

to the Notebook settings as shown above, you can also add

{
    "editorConfig": {
        "rulers": [80]
    }
}

to the Text Editor settings.

jpobst
  • 3,491
  • 2
  • 25
  • 24
Michael Gecht
  • 1,374
  • 1
  • 17
  • 26
  • 2
    Michael, Thank you for this additional information. Quick question for the SO community. Is it better to accept this answer, or to wait (maybe several months) until the feature exists, and someone (maybe Michael) can provide an answer describing how to use it? – jpobst Apr 03 '18 at 14:08
  • I think it makes sense to wait until the feature is implemented. – Guilherme de Lazari May 28 '18 at 01:18
  • I couldn't get this to work in the editor. I tried ADDING the code above to my ```edit.json``` file. When that didn't work, I tried replacing everything with just the code above (only the code block with "editorConfig"). Nothing. Any idea what else I could try? – Joe Aug 09 '21 at 14:40