bracket matching in ipython

放肆的年华 提交于 2019-12-05 20:47:05
Pierz

It is possible to get apps (including IPython) that use readline to automatically add a closing parenthesis when an open parenthesis is typed by tweaking your ~/.inputrc, as suggested here, e.g. by adding: "(": "\C-v()\e[D"

Note that according to the creator of IPython automatic bracket matching can't be done in a plain readline-based application (i.e in a normal IPython terminal session). Though it's already part of the standard functionality of IPython's qtconsole (Although as commented below auto-closing of brackets is not currently possible).

if codemirror support it then it is probably possible by monkey-patch. Configurability is on it's way but long way to go. Patches welcomed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!