Go up one command instead of one line in IPython 5

388 Views Asked by At

IPython 5 is a big release. One of its features is real multi-line editing with prompt_toolkit. The up arrow key now moves to the previous input line instead of the previous input command (block of lines).

This is awesome, but when my previous command spans many lines, and I need to reach the command before that, I find myself wishing I could go up one command at a time. Is there a way to do that? The shortcut ctrlp has the exact same behaviour as the up arrow key, so it does not provide a solution.

2

There are 2 best solutions below

0
On BEST ANSWER

On my own Belgian Mac keyboard, fnshift does the job. But I cannot tell whether this also works for other locales.

1
On

The PageUp and PageDown keys do exactly what you want without any chorded hotkeys involved; they work on an entry-oriented basis, rather than the arrow keys' line oriented approach.