Custom Keybindings for Ipython terminal

ⅰ亾dé卋堺 提交于 2019-12-23 15:53:19

问题


Is it possible to define custom keybindings and/or desactivate the default ones for Ipython terminal interface?

For example, I have bound C+j and C+l to move left and right in my terminal by configuring the ~/.inputrc file (Linux), but when using Ipython terminal, C+l is captured before and actually clears the screen.

So my questions are:

1) Is it possible to desactivate some keybindings of Ipython

2) Even better, is it possible to totally configure Ipython keymap?


回答1:


Reposting as an answer:

You can set InteractiveShell.readline_parse_and_bind in a config file (default value is here). It takes a list of readline config commands.

IPython also uses .inputrc, but things in that config value take precendence, and Ctrl+L is in there by default.



来源:https://stackoverflow.com/questions/30014267/custom-keybindings-for-ipython-terminal

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