简体   繁体   中英

How to get indentation lines in Jupyter Lab/Jupyter Notebook?

在此处输入图像描述

How can I add Indentation lines like what is shown above in Jupyter Lab/Notebook?

I have tried a lot and went into the settings (not much as I am a beginner and I don't know most of the stuff) but in Jupyter I can only get code numbers from the View button but not these beautiful lines which help a lot when doing the indentation.

The default editor used by Jupyter Notebook and JupyterLab (CodeMirror) does not support indentation markers as for today; it is possible to extend it with an add-on but it seems that there isn't one yet (see Indentation Markers with CodeMirror ). I imagine that you would need to create a custom overlay mode to make it work, and it might be in scope for jupyterlab-lsp extension if you would like to suggest this via issue on GitHub.

JupyterLab also allows to use a different editor via extension (and there was a proof-of-concept for that) but I don't think that anyone volunteered to maintain any other editor integration recently.

In the near future JupyterLab will likely migrate CodeMirror 6, and depending on availability of such feature in it it will either have a support for it or not. Or maybe someone will contribute a support for it to an extension. It might turn out to be easier to implement in CM6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM