iPython in Terminal.app: multi-line editing

1

I'm using iPython in Terminal.app (on Mac), and when I scrollback to a multi-line block it's really slow moving between lines. Is there a keybinding (or can I configure one) to make it possible to easily move between lines quickly?

marcog

Posted 2012-10-18T20:47:16.253

Reputation: 2 384

Answers

1

Ipython depends upon the readline bindings. In looking through the man page for readline, I could not find a command that skips by lines, but moving by words is better than moving by character, so I have added the lines

c.TerminalIPythonApp.exec_lines = ['import readline',
  """readline.parse_and_bind('"5D" backward-word')""",
  """readline.parse_and_bind('"5C" forward-word')"""]

to my ipython_config.py file (for details on this file see the ipython start up files reference.) Note that the "5D" comes from what appears on my screen when I type ctrlleft, and similar for ctrlright.

esmit

Posted 2012-10-18T20:47:16.253

Reputation: 141

0

I just did a quick check and with the latest version of iPython I don't have the same problem.

Have you installed the gnu readline package or the python equivalent? If you haven't then I'd recommend "sudo pip install readline" at the terminal prompt.

Tony Williams

Posted 2012-10-18T20:47:16.253

Reputation: 533