在JupyterLab代码编辑器中启用自动换行 [英] Enable word wrap in JupyterLab code editor

查看:1050
本文介绍了在JupyterLab代码编辑器中启用自动换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为jupyterlab中的代码单元启用自动换行功能,但无法找到方法.

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

已经尝试过:

  • 文件->设置->文本编辑器->用户覆盖:{"lineWrap": true},它可以在编辑器"菜单中切换为灰色的自动换行",但不能解决我的问题
  • 此代码也不起作用("Cell":{...}都没有):
  • 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
    }
  }

推荐答案

尝试以下操作,

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

作为参考,请参阅来自GitHub上JupyterLap项目的拉动请求.

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

这篇关于在JupyterLab代码编辑器中启用自动换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆